JSON Formatter
Paste any JSON and get it back clean, readable, and properly indented. Validates syntax and highlights errors.
What is a JSON formatter?
A JSON formatter takes JSON that is hard to read and re-prints it with line breaks and indentation, so a person can follow the structure. Hard to read covers a lot of ground: minified onto one long line, indented three different ways in one file, or pasted out of a log with timestamps attached. Paste it into the left panel and the result appears on the right as you type, with a line count showing the payload's size. Indentation is your choice of 2 spaces, 4 spaces, or a tab, and the output updates when you switch. It is also a validator. JSON that will not parse cannot be formatted, so broken input drops the output panel into an error state showing the parser's own message. Copy Output puts the finished JSON on your clipboard in one click.
When to use it
The most common case is an API response that comes back as one 4,000-character line. You have it sitting in a browser network tab or a curl output. You need to know whether data.items[3] has a status field, and scanning a single unbroken line for it is miserable. Paste it here and the nesting shows up in a second — which keys sit at the top level, which are buried three objects deep, whether that array holds 2 entries or 200. Same bytes, readable shape.
The other half is validation. A deploy fails because a package.json or a CloudFormation template picked up a trailing comma, or a smart quote that snuck in from a doc. Paste the file. You either get clean formatted output, which means the syntax is fine and your problem is somewhere else entirely, or you get the parser message telling you what broke and roughly where. Either answer arrives faster than re-running the build to see whether you guessed right.
There is a use for it before you commit, too. Config files that get hand-edited drift into mixed 2-space and 4-space indentation, and the result is a diff full of whitespace noise that hides the one line anybody needs to review. Run the file through with your project's indent setting, paste it back, and the next diff shows only what changed in substance. The opposite job comes up as well: collapsing the whole payload onto one line so it fits in a config value. The JSON Stringifier handles that one.
How this tool works
The tool runs your input through the browser's built-in JSON.parse, then re-serializes the resulting value with JSON.stringify using your chosen indent. That is the same parser your JavaScript runtime uses: if it parses here, it parses in your code. Error text comes from the engine itself, which is why it reads differently from one browser to the next. Because the input is parsed into real values and printed fresh, the round trip can change the document, not only its whitespace. Key order survives. Comments do not: JSON has no comment syntax, so a JSONC file or a tsconfig.json carrying // notes is rejected as invalid rather than tidied up. Duplicate keys collapse to last-one-wins, standard parser behaviour that still catches people out, since the earlier value is gone before the output renders. Very large numbers past JavaScript's safe integer range lose precision on the round trip, so a 19-digit ID like a Twitter snowflake can come back with a different last digit. When a payload is full of big integer IDs, format a copy and leave your source of truth alone.
There is no server in this. Parsing and re-printing both happen in JavaScript on the page you already have open, so your JSON never crosses the network. That matters because the payload you most need to read is usually the one you would least want to paste into someone else's backend: an API response carrying a customer record, or a bearer token sitting in a header dump.
Examples
Minified API response
Input{"id":4412,"user":{"name":"Ada Reyes","email":"ada@example.com"},"tags":["beta","admin"],"active":true}Output{ "id": 4412, "user": { "name": "Ada Reyes", "email": "ada@example.com" }, "tags": [ "beta", "admin" ], "active": true }One line becomes twelve. Now the nesting is visible: name and email live under user rather than at the top level, which is precisely the thing the minified version leaves ambiguous.
Trailing comma — a real syntax error
Input{ "name": "api-gateway", "port": 8080, }OutputInvalid JSON Expected double-quoted property name in JSON at position 43 (line 4 column 1)JSON forbids trailing commas. JavaScript object literals allow them, which is how they get into files in the first place. The output panel switches to the parser's error and position instead of showing formatted text, so you know the file is broken before your build tells you. Exact wording comes from your browser's engine and varies between them.
Tab indentation for a config file
Input{"compilerOptions":{"target":"ES2022","strict":true},"include":["src"]}Output{ "compilerOptions": { "target": "ES2022", "strict": true }, "include": [ "src" ] }Same input, tab indent selected. Match whatever your repo already uses, whether that is 2 spaces, 4 spaces, or tabs, so pasting the result back does not produce a diff full of whitespace-only changes that nobody wants to read.
Nested log payload
Input{"level":"error","ctx":{"req":{"path":"/v1/orders","method":"POST"},"err":{"code":"E_TIMEOUT","ms":30000}}}Output{ "level": "error", "ctx": { "req": { "path": "/v1/orders", "method": "POST" }, "err": { "code": "E_TIMEOUT", "ms": 30000 } } }Structured log lines are written for a log aggregator to index, and it shows. Formatting one separates the request context from the error context, so you can read the failure instead of parsing it in your head.
Frequently asked questions
How do I format JSON online?
Paste your JSON into the input panel and the formatted version appears immediately in the output panel. There is no button to press and no file to upload. Choose 2 spaces, 4 spaces, or a tab for indentation, then click Copy Output to put the result on your clipboard.
Why does my JSON say invalid?
Your JSON is invalid because it breaks one of JSON's strict rules, and the error panel shows the parser's exact message and character position. Usual culprits: a trailing comma after the last item, single quotes where JSON demands double, unquoted keys, comments (JSON has none), or a curly-quote character pasted in from a document or chat.
What's the difference between a JSON formatter and a JSON parser?
A formatter re-prints valid JSON with readable indentation so you can scan it, while a parser reports on the JSON's structure: what type the value is and how it is shaped. Use this formatter when the goal is reading or tidying the JSON. Use the JSON Parser when you want to confirm validity, check a type, or unwrap a payload that arrived double-encoded.
Is there a size limit on the JSON I can paste?
There is no fixed limit. The constraint is your browser's memory and how fast it can re-render the output as you type. Payloads in the low megabytes format fine on a normal laptop. A 50 MB export will make the page sluggish, and at that size a local command-line tool is the better fit.
Can I get a custom version of this for my team?
Yes. Zinc Online Solutions builds custom internal tools and automations: a formatter wired to your own schema validation, a shared utility page your team can bookmark, or a pipeline step that normalizes JSON on the way through. When a browser tab is not the right shape for the workflow, get in touch and we will scope something that is.