JSON Formatter
Runs in your browserPaste, drop a file, pick your indentation. It re-formats as you type.
Input
Output
The formatted version shows up here
How this one works
Paste into the left panel, or drag a .json file straight onto it. It re-parses as you type, so the formatted version on the right is always in sync. Pick the indentation you like, flip to Minify when you need it on one line, then copy or download. If the document won't parse you'll get the line and column instead of a vague complaint.
Questions
- Does any of this reach a server?
- No. The parser is plain JavaScript running in your tab — there's no backend to send anything to. You can open your network tab and check that nothing you paste is ever sent, or pull the plug and keep working offline.
- Why does it reject my trailing commas and comments?
- Because they aren't JSON. They're perfectly normal in a JavaScript object literal, and in JSON5 or JSONC, but the actual JSON grammar (RFC 8259) has no room for either — and neither does JSON.parse or the API you're probably about to send this to. Better to find out here than in a 400 response.
- Format or minify — which do I want?
- Format when a human has to read it: indentation and line breaks, easy to scan. Minify when a machine has to read it: every optional space stripped out, which is what you want going over the wire. Same data either way, so it's purely about who's reading.