How to use the json formatter
- Paste JSON into the input box (for example, a settings file or data copied from an app).
- Click “Format” for an indented, readable version, or “Minify” for the most compact version.
- If there is a mistake, the tool shows the line and column and explains what is wrong.
- Copy or download the result.
How it works
JSON is made of a few building blocks: objects in curly braces { } holding "name": value pairs, lists in square brackets [ ], text in double quotes, numbers, and the words true, false and null. Items are separated by commas, and the last item must not have a comma after it.
The checker reads your text one character at a time following the official JSON grammar (RFC 8259). The moment something does not fit — a missing comma, single quotes, an extra bracket — it stops and reports that position, counting lines and columns from 1. Valid JSON is then re-written with your chosen indentation, or with all optional spaces removed for minify.
Worked example
The input {"name": "Ada", "age": 36,} fails at line 1, column 27 with “A trailing comma before } is not allowed”. Remove the comma after 36 and Format produces a neatly indented three-line object.
Limitations
- Only standard JSON is accepted; comments, single quotes and trailing commas (allowed in JSON5) are reported as errors.
- Whole numbers longer than 15–16 digits may lose precision when formatted; the tool warns when it sees one.
- If a name appears twice in the same object, only the last value is kept in the output.
- Very large files (tens of megabytes) may be slow on phones.
Frequently asked questions
What does “Unexpected token” or “trailing comma” mean?
It means a character appeared where JSON does not allow it. A trailing comma is a comma after the last item in a list or object, which JSON forbids.
Why do I need double quotes?
The JSON standard only allows double quotes around names and text. Single quotes come from JavaScript or Python and are not valid JSON.
Is it safe to paste API keys or private data?
The data stays in your browser and is not sent anywhere. Still, treat secrets carefully and clear the box when you are done.
What is minified JSON for?
Minified JSON has no extra spaces or line breaks, so it is smaller to send or store. It contains exactly the same data as the formatted version.