How to use
- Paste your JSON into the input box.
- Choose an indentation: 2 spaces, 4 spaces or Tab.
- Press Format to spread the JSON over several lines, or Minify to squeeze it onto one line.
- Copy the output with the Copy button.
Both buttons validate the JSON first. If there is a syntax error, you get the error instead of output: its line number, its column number and what is wrong.
It is handy for reading an API response that arrives as one long line, checking a config file before you deploy it, or shrinking JSON before you paste it into a request.
How it works
- Formatting only changes whitespace. Keys stay in the order you pasted them, and values are not touched.
- Numbers are kept exactly as written.
12345678901234567890and1.50come out unchanged. They are not rounded or rewritten the way some parsers do. - Escape sequences such as
éare also kept as written. - Validation follows strict JSON: no comments, no trailing commas, no single quotes, no
NaN, no leading zeros such as01. Only the first error is reported. Fix it and press the button again to look for the next one. - The column number counts characters from the start of the line. An emoji counts as one character.
Example
This one-line API response:
{"id":42,"name":"Ada","tags":["admin","dev"],"active":true}
becomes 9 lines with Format and 2-space indentation:
{
"id": 42,
"name": "Ada",
"tags": [
"admin",
"dev"
],
"active": true
}
Press Minify on that output and you get the original line back.
Now paste {"id": 42, "name": 'Ada'}. Instead of output you see “Line 1, column 20: Strings must be wrapped in double quotes”. Column 20 is where 'Ada' starts.
Edge cases
- Trailing commas: a comma after the last item, as in
{"a": 1,}, is allowed in JavaScript but not in JSON. It is reported as an error. - Single quotes: keys and strings need double quotes.
{'a': 1}is an error. - Comments:
//and/* */comments are not part of JSON. Remove them from config files such astsconfig.jsonbefore you paste. - Duplicate keys:
{"a": 1, "a": 2}is not flagged. Both keys are kept as they are. - Missing commas between lines: when a comma is missing at the end of a line, the error points to the start of the next value, on the next line.
- Large input: you can paste up to 5 MB. Large JSON shows a “Working…” sign while it is processed, and the page stays responsive.
Frequently asked questions
Is my JSON sent to a server?
No. Formatting, minifying and validation all happen in your browser. The JSON you paste is not sent anywhere and is not saved in your browser either. Nothing is kept after you close the page, even if the config you pasted contains passwords or API keys.
What is the difference between Format and Minify?
Format adds line breaks and indentation so people can read the JSON. Minify removes all whitespace outside strings so the JSON is as small as possible. The data is the same either way.
Does it fix my JSON automatically?
No. It tells you where the first error is and why, and leaves the fix to you. Automatic fixes can guess wrong, for example by dropping a value you meant to keep.
Can I use tabs instead of spaces?
Yes. Choose Tab before you press Format.