JSON
Format, convert, compare and turn JSON into something else.
- JSON Formatter & ConverterFormat, minify, sort keys, or convert a document to CSV.
- JSON DiffCompare two documents structurally, ignoring formatting and key order.
- JSON to TypeScriptGenerate interfaces from a sample, with every guess marked.
When you would reach for these
Reach for the Formatter when a document is valid but unreadable: minified into one line, indented inconsistently, or with keys in whatever order the producing service happened to emit. Sorting keys is the underrated option there. Two documents that differ only in key order produce a noisy diff until both are sorted, after which the real difference is the only thing left standing.
Reach for the Diff when two documents should match and do not. A text diff on JSON is close to useless, because reformatting one side changes every line while changing no data at all. A structural comparison ignores formatting and key order by construction and reports what actually differs: which paths were added, which were removed, and which hold a different value.
Reach for JSON to TypeScript when you have a real response from an API and need types for it. Writing an interface by hand from a sample is mechanical work that is easy to get subtly wrong, particularly around fields that are sometimes null and arrays that happen to be empty in the example you copied.
What these tools will not do
None of them repairs your document. If a file does not parse, the error explains where and why, and your text is left exactly as you pasted it. That is deliberate rather than a missing feature: a tool that quietly fixes a trailing comma has destroyed the evidence you came to look at, and the next person to hit the same bug has nothing to go on.
Type generation is inference from one sample, not a specification. A field that happens to be null in your example cannot be distinguished from a field that is always null, and an empty array says nothing about what belongs in it. The generated types are a first draft to correct, and the tool marks where it had to guess rather than presenting a guess as settled.
Your tool input is processed locally in your browser and is not intentionally uploaded to our servers. Advertising and analytics providers may still process normal page, device, cookie and network information. That matters more here than it might appear, because JSON pasted into a formatter is very often a real API response about a real person.