Your JSON
About this JSON formatter
JSON is text that programs use for names and values — a short example is {"city":"Paris","ok":true}. You often get it as one long line from a website or a file. This JSON formatter spreads that line out so you can read it, or squeezes it back onto one line (minify).
Click Format to add spaces. Click One line to take the spaces out. The meaning stays the same. “Sort names A–Z” only reorders the labels inside { }. Items in a list [ ] keep the same order.
Everything stays in this tab. If a comma is extra, a name has no quotes, or the quotes are the wrong kind, you will see a warning. Fix the text in the box — the page will not guess the missing bits.
Spaces or one line
Format adds spaces so nested parts line up. One line (minify) is the same content with those spaces removed — shorter to copy.
| Choice | Notes |
|---|---|
| 2 spaces | Easy to read; the usual choice |
| 4 spaces | A bit more air between levels |
| Tab | If you prefer a tab instead of spaces |
| One line | Same data, no extra spaces, shorter to copy |
How to format JSON
- Paste the JSON: There is already a short example in the box if you want to try Format first.
- Click Format or One line: Format spreads the text out. One line packs it tight. Tick sort names if you want A–Z inside { }.
- Copy the result: It stays in this tab. Nothing is sent to a server.
Frequently asked questions
Is the JSON uploaded or stored?
No. Your browser reads it on this page. Close the tab and it is gone. There is no account and no copy on a server.
Why does it say the JSON is not valid?
JSON is picky. A comma at the end, quotes like 'this', a name without quotes, or a comment will fail. The warning under the box points at the first problem. Fix that bit and click Format again.
What does One line (minify) do?
It writes the same names and values with no extra spaces, usually on one line. Nothing in the data changes. Use Format when you want to read it; use One line when you want a short copy.
Does sorting names change lists?
No. Only the labels inside { } are put in A–Z order. A list in [ ] keeps the same order, because that order is part of the data.