JSON Formatter: format, minify and validate
Paste JSON to format it with clean indentation, minify it to one line, or check it for errors. Invalid JSON is flagged with the line and column of the problem, so you can fix it fast.
Formatting happens in your browser. Your JSON is never uploaded: API responses or config files with private data stay in this browser tab and are not sent to a server.
How to use the JSON formatter
- Paste your JSON into the box, or type it.
- Click Format to pretty-print it with the indent you choose, or Minify to strip all spaces and line breaks.

- If the JSON is invalid, a message shows the line and column where parsing stopped, and the cursor jumps there.
- Copy the result or download it as a .json file.
Common JSON errors
| Problem | Wrong | Right |
|---|---|---|
| Trailing comma | [1, 2, ] | [1, 2] |
| Single quotes | {'a': 1} | {"a": 1} |
| Unquoted key | {a: 1} | {"a": 1} |
| Comments | // note | Not allowed in JSON |
| Special values | NaN, undefined | null or a number |
To rename keys for code, the case converter turns text into camelCase or snake_case. For a random token or test password, use the password generator.
Frequently asked questions
Does formatting change my data?
No. Only the spaces, tabs and line breaks between values change. Keys, values and their order stay exactly as you typed them, including how numbers and escapes are written (1.50 stays 1.50, 1e3 stays 1e3, very long numbers keep every digit, \u00e9 stays \u00e9), unless you tick "Sort keys A to Z". If an object has the same key twice, both copies are kept and the tool warns you, because many programs keep only the last one.
What is the difference between formatting and minifying?
Formatting adds line breaks and indentation so people can read the structure. Minifying removes every unnecessary space and line break, which makes the file smaller for sending over a network or storing in code.
Can it handle large files?
Files of several megabytes work in a modern desktop browser. Very large files may be slow on phones because the whole text is processed in memory.
Does it support JSON with comments (JSONC or JSON5)?
No. The tool follows the strict JSON standard, so comments, trailing commas and single quotes are reported as errors. That is useful when your file must be valid for an API or a strict parser.