Format, validate and minify JSON, no guessing where the error is
You pasted an API response and it is one long line with no indentation. Or you have a config with hundreds of keys and you do not even know whether it is valid. Or you want to send JSON in a payload and you care about keeping it as small as possible.
This tool does three things: formats (readable 2/4 space or tab indentation), minifies (zero whitespace, smallest possible size) and validates (green "Valid JSON" badge or a red error with the exact line and column where it fails).
Everything runs in your browser, nothing is sent anywhere. Parsing uses the native JavaScript engine (the same one Node.js and Chrome use), so validation matches exactly what your backend will accept. Plus stats: nesting depth, total key count, type breakdown (strings, numbers, booleans, null). Handy for debugging, code review, and figuring out somebody else's payload.
How to use it
- Pick a mode at the top: Format (readable, with indentation), Minify (compact, one line) or Validate (just checks correctness and shows stats).
- Paste your JSON into the left panel. A realistic API-response sample (a shop order) is loaded by default, so you see what the tool does immediately. Overwrite it or hit "Clear".
- In Format mode pick the indent: 2 spaces (web standard), 4 spaces (easier to read on deep structures) or tab (if that is what your project uses).
- Flip Sort keys (alphabetical within every object) to make two payloads easier to diff. Arrays keep their original order.
- In Minify mode you also see size before and after plus the percent saved. A typical saving for nicely-formatted JSON is 30-50%.
- If the JSON is invalid, the right panel shows a red box with the error message plus the exact line, column and character position. The usual suspects: missing comma, trailing comma, unterminated string.
- Stats below: depth (deepest nesting), total keys, total values, type breakdown. Useful for spotting payloads that are "too wide" or "too deep" for your database.
- Hit Copy in the right panel to copy the result to your clipboard. Everything happens locally, no data ever leaves your browser.
When this is useful
Six typical situations where this tool saves you manual work:
- Debugging an API response. You got one long line from a fetch call. Paste it, format with 2-space indent, see the structure in 3 seconds, and spot the field that is null instead of an object, the exact cause of the bug you were chasing.
- Sanity-checking a config before deploy. Your package.json, tsconfig.json or CI workflow has to be valid JSON, otherwise the build will fail. Paste, validate, and you see there is a trailing comma after the last array item on line 47, the classic 20-minute bug.
- Comparing two payload versions. You have a response from two environments (staging vs production) and you want to know what differs. Turn on "Sort keys" for both, paste both into your diff tool, and you see the real differences in 5 seconds, without "field reordered" noise drowning out the actual changes.
- Optimizing payload size. You send JSON over WebSocket or HTTP and you care about how much it weighs. Minify: you see 2.4 KB drop to 1.2 KB, exactly 50% less data on the wire. Multiply by 10 000 daily requests and you have real savings.
- Code-reviewing somebody else's JSON. A colleague pasted an unformatted config into a PR. Paste, format, you see the structure. Plus stats: depth 7, 340 keys, red flag, payload too wide, suggest splitting into separate files.
- Learning a new API. You got a sample response from a vendor (Stripe, GitHub, Slack), paste, format, understand the structure in 30 seconds instead of crawling the docs. You also see how many fields are optional (nulls) and how nested it is.