| Mistake | Fix |
|---|---|
Trailing comma: {"a":1,} | Remove the comma before } or ] |
Single quotes: {'a':1} | Use double quotes for keys and strings |
Unquoted key: {a:1} | Wrap keys in double quotes: {"a":1} |
| Comments in JSON | Not allowed — remove // or /* */ comments |
Your JSON is parsed and formatted entirely in your browser using JavaScript's built-in JSON support. There is no upload step or server involved, so it's safe to use with API keys and private data.
How this tool works
Paste or type JSON into the input box, then click Format to beautify it with your chosen indentation, or Minify to strip all unnecessary whitespace. Both actions validate the JSON first — if it's invalid, you'll see exactly which line and column caused the problem instead of a generic error.
Everything runs using your browser's built-in JSON.parse and JSON.stringify — there's no server round-trip, so results appear instantly and nothing you paste is ever transmitted anywhere.
Frequently asked questions
Does this tool send my JSON data anywhere?
No. Parsing, formatting, validating and minifying all happen locally in your browser using JavaScript's built-in JSON support. Nothing is uploaded or transmitted to a server, which makes it safe to use with private API keys, config files, or sensitive data structures.
What's the difference between formatting and minifying?
Formatting (beautifying) adds consistent indentation and line breaks so JSON is easy to read. Minifying removes all unnecessary whitespace to produce the smallest possible file size, which is typically what you'd send over a network or store.
Why does it say my JSON is invalid?
The most common causes are a trailing comma after the last item, single quotes instead of double quotes, unquoted property names, or a missing closing bracket. The tool shows the line and column where parsing failed whenever your browser provides that detail, and otherwise shows the browser's error message directly.
Can I sort JSON keys alphabetically?
Yes, enable "Sort keys alphabetically" before formatting or minifying and every object's keys will be reordered alphabetically at every nesting level. Array order is always preserved.
Is there a size limit?
There's no hard limit — it depends on your browser's available memory. Typical API responses and configuration files of a few megabytes format instantly.
Is this JSON formatter free?
Yes, completely free with no account, signup, or usage limit.