Convertor PRO — Examples
Convertor PRO in practice: JSON to YAML and TOML, XML as JSON, large IDs kept exact, emoji escapes, HTML entities, and untangling mixed escapes.
Back to the overview: Convertor PRO · Open the live tool: www.jpkc.com/tools/convertor/
The Manual describes every field and mode in detail. This page adds concrete runs: typical tasks, step by step, focused on what you enter and what comes out. Tab and button names are given exactly as they appear in the tool's interface.
Example 1: JSON to YAML
You have a compact JSON config and want it as readable YAML — say for a CI pipeline or a docker-compose-style file.
- Open Convertor PRO and switch to the Data Formats tab.
- Leave Source on
Auto-detectand set Output toYAML. - Paste your JSON on the left, e.g.:
{ "service": "web", "port": 8080, "tags": ["a", "b"], "debug": true }- The badge next to Source shows
JSON, and a moment later the right-hand side reads — no click on Convert needed:
service: web
port: 8080
tags:
- a
- b
debug: trueYAML writes strings without quotes, numbers and booleans stay typed, and arrays become lists. Copy to clipboard grabs the result; Save as file downloads it as converted.yaml.
Example 2: YAML to TOML
Same family, opposite direction: you want a YAML config as TOML, e.g. for a Rust or Python tool that expects pyproject.toml-style files.
- In the Data Formats tab: Source on
Auto-detect(orYAML), Output toTOML. - If the output from Example 1 is still on the right, just click Swap — the YAML output slides left and becomes the new input, and the target format jumps back to
JSON; then set it toTOML. - Otherwise paste your YAML:
title: My Project
owner:
name: Jane
active: true- The right-hand side shows:
title = "My Project"
[owner]
name = "Jane"
active = trueNested objects become [table] blocks. Note that comments from the YAML do not carry over — the conversion runs through a pure data intermediate stage (see Limits and edge cases). If your YAML contains a null, TOML drops that key — and says so in a notice below the editors.
Example 3: Text to hex and Unicode
You're embedding an emoji or a special letter into HTML, CSS, or a JavaScript string and need the correct escape notation.
- Switch to the Encoding tab.
- Type the character into the Characters field, e.g.
😀orcafé. - All other fields fill in while you type (you only need the Convert button next to Characters if you don't want to wait). For
😀you can read off:- Hexadecimal NCRs:
😀(for HTML/XML) - Unicode U+hex:
U+1F600 - UTF-8 code units:
F0 9F 98 80 - UTF-16 code units:
D83D DE00— the surrogate pair - CSS escapes:
\1F600(with a trailing space) - JavaScript escapes:
\uD83D\uDE00— the surrogate pair as two\uescapes
- Hexadecimal NCRs:
- If you'd rather have the shorter ES6 form in JavaScript, switch the Above U+FFFF dropdown to
\u{1F600} (ES6)— the field then shows\u{1F600}; for C or Python there is\U0001F600 (C, Python). - Use the copy button next to the relevant field to grab exactly the notation you need.
Tip: if you only want to escape the special characters and keep ASCII letters readable, leave the Keep ASCII checkbox on (the default) — then café becomes café in Hexadecimal NCRs, and only the é is converted.
Example 4: Decoding HTML entities
You have text from some source containing entities like &, ü, or —, and you want the plain text.
- Encoding tab.
- Paste the text into the HTML/XML field, e.g.
R&D über alles — good. - Shortly afterwards the Characters field holds the plain text:
R&D über alles — good. The field understands every named HTML5 entity (&,ü,—, …) just as well as numeric ones (—).
For wildly mixed escapes from several notations at once, use the Mixed input field instead — it resolves different escape kinds in one go (see Example 8).
Example 5: XML readable as JSON
An API returned XML and you want to grasp the structure quickly as JSON.
- Data Formats tab, Source on
Auto-detect. Paste the XML with Paste from clipboard or straight into the editor — the leading<is enough, and the badge next to Source showsXML. - Set Output to
JSON. From
<book id="42"><title>Faust</title><year>1808</year></book>you get
{
"book": {
"@id": 42,
"title": "Faust",
"year": 1808
}
}- Note the conventions: the name of the root element (
book) is kept as the top-level key, attributes get an@prefix (@id), and text and attribute values written exactly like a number ortrue/falseare typed (42and1808become numbers). A postal code like01234, on the other hand, would stay a string. Repeated same-named elements would become an array. Convert the JSON back to XML with Swap and you get<book id="42">…</book>again, preceded by an XML declaration.
Example 6: INI to JSON — and why not every road leads back
INI is handy for reading legacy configurations.
- Data Formats tab. Source to
INI(orAuto-detect), Output toJSON. Input:
debug = true
[database]
host = localhost
port = 5432- The right-hand side shows nested JSON with
debugat the root and adatabaseobject. Unquoted values are only typed when they are unambiguous:truebecomes a boolean,5432a number —yes,on, or0755, on the other hand, would stay strings. - The reverse hits INI's limit: deeply nested objects are flattened with dot notation when written to INI (
db.host = …) without a notice, lists of plain values becomekey[] = …lines, and a list containing objects or lists ends up as a JSON string in the value — with a notice. When read back,db.hoststays a key with a dot in it, so the original nesting does not return. For richly structured data, JSON, YAML, or TOML is the better target.
Example 7: Passing large IDs through digit for digit
An API export contains 64-bit IDs and prices like 1.0. Through an ordinary JavaScript number, 12345678901234567890 would silently become 12345678901234567000 and 1.0 would become 1 — when Convertor PRO reads JSON, it passes both through exactly.
- Data Formats tab, Source on
Auto-detect, Output toYAML. Input:
{"id": 12345678901234567890, "price": 1.0, "n": 3}- The right-hand side shows:
id: 12345678901234567890
price: 1.0
'n': 3The ID is exact to the last digit, and 1.0 stays a float. (The YAML library adds the quotes around the key n on its own; they don't change the content.)
3. Switch Output to TOML. Now you get id = "12345678901234567890" — TOML only knows 64-bit integers, the ID doesn't fit, and it becomes a string. The notice box names the spot: "TOML integers are 64-bit — 12345678901234567890 written as a string (id)."
4. The way back is not digit-exact: had you clicked Swap after step 2, the YAML would have become the source and JSON the target — and because the tool reads YAML numbers as ordinary JavaScript numbers, you would then see 12345678901234567000 and 1, without a notice. So keep the JSON original instead of recovering it from the YAML.
Example 8: Untangling escape soup with Mixed input
A line from a log, a database, or some source code has several escape kinds jumbled together.
- Encoding tab, topmost field Mixed input. Paste:
Café U+00FC %C3%B6 \u00E9 in C:\temp- While you type, Characters already shows
Café ü ö é in C:\temp. The Windows path stays intact because the Decode \n, \t, \xHH checkbox is off. - Tick the checkbox and
\tturns into a tab character — right for a JavaScript string likeline 1\nline 2, wrong for a path. So decide based on where the text comes from. - If there are only bare numbers, such as
Bytes: C3 BC 20 E2 82 ACfrom a hex dump, click UTF-8 — resultBytes: ü €. With Hex CP,48 65 6C 6C 6Fturns into the wordHello.
More tricks — what round-trips lose, using format detection deliberately, combining with other tools — are in Tips & Tricks.