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:
- “No signup to save” usually means public storage. Several of the popular formatters offer a share link: your document is POSTed to their server, stored, and — as one of them puts it in its own interface — “it will become public”. Here nothing is stored and no share link is created; the document lives in your tab and disappears when you close it.
- They eat your comments. Most online formatters parse the file into a data structure and print it again, which silently deletes every YAML and XML comment. This one formats through a document model, so comments, key order, CDATA sections and processing instructions survive — you can reformat a commented config and diff it without losing the explanation someone wrote next to a value.
- “Invalid” is not a diagnosis. A red banner that says the JSON is invalid tells you nothing at 200 lines. Errors here carry a line and a column plus a plain-language reason — trailing comma, single quotes, an unquoted key, a comment in JSON, an unterminated string, a closing tag that does not match — and the same for YAML, XML and TOML.
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.