Skip to content
beginthings.

Dev & Data

JSON to YAML, XML & TOML converter, with JSON diff

Paste JSON and pick an output: YAML, XML or TOML. Or choose Compare to see exactly what changed between two JSON documents. Large numbers keep their exact digits.

Convert

What do you want to do?

Result

How to use this tool

  1. Paste your JSON into the box.
  2. Choose JSON to YAML, XML or TOML, or Compare two JSON.
  3. For Compare, paste the second document. For XML, set the root and item names.
  4. Copy or download the result, or the list of differences as CSV.

How it works

YAML output uses two-space indentation and quotes a string only when it has to, for example when it looks like a number, a date, yes or null, or contains a colon followed by a space. XML output turns each key into an element and repeats the element for each array item, and keys that are not valid XML names are adjusted and listed. TOML output writes plain keys first, then [tables] and [[arrays of tables]].

The compare mode walks both documents and lists every difference with its path, such as $.owner.since or $.tools[0].users, marked added, removed or changed. Key order inside objects never counts as a difference, and you can choose to ignore the order of array items too.

Good to know

Some data does not map one to one. TOML has no null, so null values are left out and listed in a warning, and a TOML file must start with an object rather than an array. XML has no types, so numbers and booleans become text. YAML can represent everything JSON can, which makes it the safest round trip.

Integers larger than 9,007,199,254,740,991 cannot be stored exactly in a JavaScript number. Where your browser supports it, the converter keeps their original digits so IDs are not silently rounded. Everything runs in your browser, so configuration files and API responses stay on your device.

Frequently asked questions

Is my JSON uploaded?

No. Parsing and converting happen in your browser.

Why are some values missing from the TOML?

TOML has no null type, so null values are left out. The warning lists them.

Does key order matter in the compare mode?

No. Objects are compared by key, so reordered keys are not a difference. Array order matters unless you tick "Ignore the order of array items".

Can it convert YAML or XML back to JSON?

Not yet. It converts from JSON only.

What if my JSON is invalid?

You get the line and column of the first error. The JSON formatter can repair common mistakes.

More free tools you might need