JSON Formatter & Validator
Format, validate, and minify JSON documents.
This tool runs entirely in your browser. Your data is never uploaded, never stored, and never leaves your device.
The JSON Formatter takes minified, messy or hand-edited JSON and re-indents it into readable structure, while validating it and pointing to the exact position of any syntax error.
How to use it
- 1Paste your JSON — an API response, a config file, or a log line.
- 2Press Format for indented output, or Validate for a straight pass or fail — nothing happens while you type.
- 3Use Minify to strip all whitespace back down to the smallest valid form.
Example
- Input
- {"b":2,"a":1}
- Output
- { "b": 2, "a": 1 }
Key order is preserved exactly — formatting never reorders your data.
What happens to your data
This tool runs entirely in your browser. Your input is never uploaded to a server, never stored, and never logged. That matters when the payload is an auth response or customer record.
Last updated August 2026
The JSON Formatter takes messy, minified, or hand-edited JSON and turns it into clean, properly indented, readable structure — instantly. Paste an API response, a config file, or a log line and get formatted output you can actually read, plus validation that pinpoints exactly where a stray comma or bracket breaks the document.
It is built for the moment every developer knows: an API returns a wall of unformatted JSON and you need to understand it *now*. Formatting, minifying, and validating all happen in one place, with your data never leaving the page.
Two different things get called formatting JSON, and only one of them happens here. This parses the text into values and prints them out again, so what comes back is canonical JSON rather than your document with tidier whitespace. A formatter that works on the tokens instead — Prettier, or your editor's built-in — leaves the original text alone and only moves the spaces.
The distinction decides most of the surprises. Comments are not part of JSON, so a tsconfig.json or an .eslintrc carrying them is reported as invalid rather than cleaned up, and duplicate keys collapse to the last one without a word.\n\nJSON formatter, JSON beautifier, JSON viewer, JSON validator \u2014 these are not four names for one thing, and knowing which you want saves time. To format JSON or prettify JSON is to re-indent it so a person can read it; a JSON pretty print is the same operation under an older name. A viewer adds a collapsible tree so you can fold away the parts you do not care about. A validator answers a different question: not how it looks but whether it parses, and where it stops if it does not. This does the formatting and the validating together, because in practice you find out the document is broken by trying to tidy it.
How it works
Toolvore parses and re-serialises JSON entirely in your browser using the native JSON engine. Nothing is uploaded to a server, so even sensitive payloads — auth responses, customer records, internal configs — stay on your machine. Invalid JSON is caught during parsing and the error points to the offending position. A round trip through that engine cannot preserve anything the parser throws away on the way in. Numbers come back the way JavaScript writes them rather than the way you typed them, so 1.50 arrives as 1.5 and 1e3 as 1000, and any integer beyond about sixteen digits — a database ID, a snowflake — comes back altered, because it was never held exactly to begin with. Keys that look like whole numbers are also reordered ahead of the rest, in ascending order.
Common use cases
- Reading and debugging API responses while building or testing integrations
- Validating configuration files (package.json, tsconfig, CI configs) before committing
- Cleaning up minified JSON copied from network tabs or logs
- Minifying JSON to reduce payload size before shipping
- Spotting structural errors — a missing comma, unquoted key, or trailing bracket
- Matching a file's indentation to a repository that uses tabs or four spaces
- Working out whether a config file is really JSON or the comment-carrying JSONC dialect
Frequently asked questions
Is the Toolvore JSON Formatter free?+
Yes. It is completely free with no signup, and it runs directly in your browser.
Does my JSON get uploaded to a server?+
No. All formatting and validation happen locally in your browser — your data never leaves your device.
What is the difference between formatting and validating?+
Formatting re-indents JSON so it is readable; validating checks that the JSON is syntactically correct and reports the exact location of any error.
Can it handle large JSON files?+
Yes, within your browser's memory limits. Because processing is local, very large documents depend on your device rather than a server timeout.
How do I minify JSON?+
Paste your JSON and use the Minify action to strip all whitespace, producing the smallest valid representation.
Why does my JSON say invalid when it looks fine?+
Nearly always a character that is legal somewhere else and not in JSON. Single quotes round strings, unquoted keys, a trailing comma after the last item, a comment, or the curly quotes a word processor substitutes when text passes through one. Python's True, False and None are a regular cause, as are NaN and Infinity, none of which JSON has. Read the position in the error, then look just before it — a parser reports where it gave up, which is usually one token after the mistake itself.
Can JSON have comments?+
No. The format has no syntax for them, which is why a plain parser rejects a file that carries any. What confuses this is that several tools accept a relaxed dialect called JSONC and still give the file a .json name — tsconfig.json, VS Code's settings, a good many .eslintrc files. Those are read by parsers built to skip comments and will not survive an ordinary one. If a note has to travel with the data, the usual dodge is a plain key such as _comment, valid JSON and ignored by anything not looking for it.
Why did the long ID number in my JSON change?+
Because JavaScript holds every number as a double, which counts whole numbers exactly only to about nine quadrillion — roughly sixteen digits. Anything longer is rounded to the nearest value a double can hold, and the original digits are then gone for good. Order IDs, Discord and Twitter snowflakes and some database primary keys all sit past that line. The fix is upstream rather than here: have the service send the value as a string, in quotes, so it is carried as text and never converted.
Should JSON be indented with 2 spaces, 4 spaces or tabs?+
The format does not care — whitespace between tokens means nothing to a parser, so this is only a question of what the people reading the file expect. Two spaces has become the default across the JavaScript world, and it is what npm writes back into package.json when it edits one, so a file kept at four tends to get quietly reset the next time a dependency is added. Tabs suit anyone who wants the width chosen by the reader. The rule worth keeping is to match the repository, since changing it turns a one-line edit into a whole-file diff.
Can I format a log file that has one JSON object per line?+
Not as one document. That layout is NDJSON, also called JSON Lines, and it is deliberately not valid JSON — a document holds exactly one value, so a second object fails the moment the parser reaches it. The arrangement is useful precisely because each line stands alone and a reader can work through a huge file without holding it all in memory. To read one entry, take a single line and format that. For a whole file, a line-oriented tool such as jq is the right instrument; splitting it is a step you have to do yourself.