Code Formatters & Validators

Tools for formatting, validating and comparing structured data. All processing happens in your browser, so your data is never uploaded.

Choose a formatting tool

Use the JSON formatter for indenting, minifying and exploring a payload, the compare tool when two responses should be identical and are not, and the stringify tool when a document has to be embedded inside another one as a string.

Use the YAML validator for configuration files, where the interesting failures are indentation and implicit typing rather than syntax, and the XML formatter for documents and SOAP payloads, where mixed content means whitespace is sometimes part of the data.

Real parsers, not regular expressions

Every tool in this category parses the document properly before it prints anything, which is what lets it point at the line and column where the input stopped being valid instead of reporting that something, somewhere, is wrong. It is also why a document that formats cleanly here will load in your own language's parser.

The trade is strictness. These parsers follow the specifications rather than the lenient behaviour some libraries add, so a trailing comma, a tab used for indentation or an unescaped ampersand is an error here even where a particular tool in your stack would have accepted it.

Formatting rewrites bytes, not meaning - with exceptions

Indenting a document parses it and writes it out again, and a few things are normalised on that trip. In JSON, duplicate keys collapse and very large integers lose precision. In YAML, anchors are resolved and comments disappear on conversion. In XML, attribute order and comments survive, but whitespace inside mixed content is data and is deliberately left alone.

None of that matters for reading a payload in a debugger. It matters a great deal if the formatted output is what you commit, so when a document is the source of truth, format a copy and diff it against the original before replacing anything.

Which format belongs where

JSON is the interchange default: no comments, no ambiguity about types, parsers everywhere. YAML earns its place in configuration, where comments and reuse matter and a human edits the file by hand. XML persists where schemas, namespaces and signatures are part of the contract, which is most of enterprise and government integration.

Converting between them is rarely free. JSON gains nothing from YAML's anchors and loses its comments; XML attributes have no obvious JSON equivalent, and every converter invents its own convention. Convert when a system on the other end requires it, not to tidy a file up.