BrowserDevTools

JSON / YAML / XML / TOML toolbox

Paste a document: it is formatted, validated and converted in place — comments kept for YAML and XML, errors reported with the line and column, and a structural diff when you want to see what changed between two versions.

Comments, key order, CDATA and processing instructions survive when the source and target are the same format. Converting to another format goes through a value model, so comments cannot survive — the notes say when that happens.

The document is parsed in this tab. Nothing is uploaded, nothing is stored, and no share link is created — unlike formatters whose “save” button posts your file to their server.

Output

The {format} parser is still loading (it is fetched on demand so the page stays light). Try again in a moment.

Three things the usual formatter gets wrong

Formatting JSON is solved, and there is no shortage of pages that do it. The interesting part is what those pages do beyond the pretty-print — and three habits stood out when I went through the first page of results for “json formatter”:

So this page does those three differently, and adds the conversion matrix on top:

Everything runs locally: the parsers are fetched on demand (so the page stays light until you actually paste something), the document never leaves the tab, and there is no share link to leak it. Conversion between formats goes through a generic value model, which is honest about its limits and states them in the notes: XML attributes become “@name” keys and repeated children become arrays; YAML anchors are expanded; comments survive formatting but not conversion. One more deliberate omission: TOML and YAML cannot represent every JSON shape, so a conversion that cannot be expressed fails loudly instead of writing something subtly wrong.

FAQ

Is my document uploaded?
No. Parsing, formatting and diffing all happen in your browser tab; the YAML and TOML parsers are fetched from the same origin on demand, and nothing you paste is sent anywhere. You can confirm that in the Network panel. The comparison to make is with formatters that offer a “share” link — that one does upload your file, and usually stores it publicly.
Are comments really preserved?
Yes, for YAML and XML when the source and target formats match: YAML is re-emitted through its document model, and XML is re-indented by a tokeniser that keeps comments, CDATA, the XML declaration, DOCTYPE and processing instructions. Cross-format conversion goes through a value model, so comments cannot survive — the output says so in the notes.
How precise are the error positions?
JSON errors are located by a dedicated scanner (modern V8 no longer reports a position at all, so the line and column are computed here) and the message names the usual suspects: trailing comma, single quotes, unquoted key, comment, unterminated string. YAML positions come from the parser, XML positions from the tokeniser, and TOML reports its own.
What does the diff compare?
Structure, not text. Both documents are parsed and compared as data, so a key that moved, a value that changed type, an array that grew or a key that disappeared each show up as a path (servers[1].port) with the before and after value — no more squinting at two coloured walls of text.
Which conversions are supported?
Any direction between JSON, YAML, XML and TOML, subject to what the target can express: TOML needs an object at the top level and has no null, so a conversion that cannot be represented is reported as an error rather than silently mangled. XML uses the conventional mapping — attributes become @name, repeated elements become arrays, text becomes the value.