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.

  1. Open Convertor PRO and switch to the Data Formats tab.
  2. Leave Source on Auto-detect and set Output to YAML.
  3. Paste your JSON on the left, e.g.:
{ "service": "web", "port": 8080, "tags": ["a", "b"], "debug": true }
  1. The badge next to Source shows JSON, and a moment later the right-hand side reads — no click on Convert needed:
yaml
service: web
port: 8080
tags:
  - a
  - b
debug: true

YAML 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.

  1. In the Data Formats tab: Source on Auto-detect (or YAML), Output to TOML.
  2. 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 to TOML.
  3. Otherwise paste your YAML:
title: My Project
owner:
  name: Jane
  active: true
  1. The right-hand side shows:
title = "My Project"

[owner]
name = "Jane"
active = true

Nested 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.

  1. Switch to the Encoding tab.
  2. Type the character into the Characters field, e.g. 😀 or café.
  3. 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 \u escapes
  4. 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).
  5. 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.

  1. Encoding tab.
  2. Paste the text into the HTML/XML field, e.g. R&D über alles — good.
  3. 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.

  1. 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 shows XML.
  2. Set Output to JSON. From
<book id="42"><title>Faust</title><year>1808</year></book>

you get

json
{
  "book": {
    "@id": 42,
    "title": "Faust",
    "year": 1808
  }
}
  1. 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 or true/false are typed (42 and 1808 become numbers). A postal code like 01234, 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.

  1. Data Formats tab. Source to INI (or Auto-detect), Output to JSON. Input:
debug = true
[database]
host = localhost
port = 5432
  1. The right-hand side shows nested JSON with debug at the root and a database object. Unquoted values are only typed when they are unambiguous: true becomes a boolean, 5432 a number — yes, on, or 0755, on the other hand, would stay strings.
  2. 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 become key[] = … lines, and a list containing objects or lists ends up as a JSON string in the value — with a notice. When read back, db.host stays 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.

  1. Data Formats tab, Source on Auto-detect, Output to YAML. Input:
{"id": 12345678901234567890, "price": 1.0, "n": 3}
  1. The right-hand side shows:
id: 12345678901234567890
price: 1.0
'n': 3

The 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.

  1. Encoding tab, topmost field Mixed input. Paste:
Caf&#xE9; U+00FC %C3%B6 \u00E9 in C:\temp
  1. While you type, Characters already shows Café ü ö é in C:\temp. The Windows path stays intact because the Decode \n, \t, \xHH checkbox is off.
  2. Tick the checkbox and \t turns into a tab character — right for a JavaScript string like line 1\nline 2, wrong for a path. So decide based on where the text comes from.
  3. If there are only bare numbers, such as Bytes: C3 BC 20 E2 82 AC from a hex dump, click UTF-8 — result Bytes: ü €. With Hex CP, 48 65 6C 6C 6F turns into the word Hello.

More tricks — what round-trips lose, using format detection deliberately, combining with other tools — are in Tips & Tricks.