Toolvore

JSON Formatter & Validator

Format, validate, and minify JSON with exact line errors, a searchable tree, and private processing.

This tool runs entirely in your browser. Your data is never uploaded, never stored, and never leaves your device.

The JSON Formatter beautifies or minifies JSON without changing number spellings or duplicate keys, pinpoints syntax errors, and turns valid data into a searchable tree.

How to use it

  1. 1Paste JSON, drop a local .json file, or load the sample.
  2. 2Format, minify, validate, or explicitly sort object keys; an error shows its exact line and column.
  3. 3Read the syntax-coloured code or search and collapse the tree, then copy or download the result.

Example

Input
{"b":2,"a":1}
Output
{ "b": 2, "a": 1 }

Normal formatting preserves key order and original number spellings; only the separate Sort keys action reorders objects.

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 September 2026

The JSON Formatter takes a minified API response, config file, or hand-edited payload and turns it into readable structure without rewriting the data hidden between the spaces. Paste text or drop a local .json file, then beautify it, minify it, validate it, or explore it as a collapsible JSON tree.

When a document is broken, a useful validator must do more than repeat a parser message. This one reports the exact line and column, shows the surrounding line with a caret, and lets you jump back to the failing character. Smaller documents validate while you type; above 64 KiB, validation waits until you press Validate, Format, Minify, or Sort so the browser does not build the same large syntax tree twice.

Formatting here is token-aware rather than a JSON.parse then JSON.stringify round trip. That distinction protects values developers cannot afford to mutate: 9007199254740993 stays 9007199254740993, 1e3 stays 1e3, duplicate keys remain present, and the original key order remains unchanged. The separate Sort keys action is deliberately explicit because sorting is useful for review but does reorder every object.

JSON formatter, JSON beautifier, JSON viewer, and JSON validator describe related jobs. To format JSON or prettify JSON is to change whitespace; a JSON pretty print is the same result; validation checks the grammar; minifying removes optional whitespace; a viewer makes nested data navigable. Toolvore combines those jobs on one page, with searchable tree paths, copy and download actions, and all processing kept on your device.

How it works

Toolvore tokenises and validates the text inside your browser, then changes only whitespace between valid JSON tokens. Nothing is uploaded, stored, or added to a URL, so auth responses, customer records, and internal configs stay on your machine. Strings and numbers keep their original source spelling, while a lossless syntax tree powers the viewer without collapsing repeated keys. Invalid input is stopped with a structured error containing an offset, line, column, excerpt, and caret. To keep an accidental giant or maliciously deep document from freezing the tab, input is capped at 5 MiB, 100,000 JSON tokens, and 256 nesting levels.

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
  • Searching a nested response and copying the JSONPath to a field
  • Loading a local .json file and downloading a clean formatted copy

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?+

It accepts documents up to 5 MiB, subject to structural guards of 100,000 JSON tokens and 256 nesting levels. Those limits keep a huge or pathological payload from freezing the browser; larger or unusually dense files are better handled with a streaming command-line tool such as jq.

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.

Will formatting change long IDs, exponent notation, duplicate keys, or key order?+

No. Format and Minify work from the original tokens instead of converting numbers into JavaScript values, so a long integer, 1e3, repeated property, and the order you supplied survive exactly. Sort keys is the one action that changes object order, and it is labelled separately. Other programs may still round an unquoted integer when they parse it, so APIs should send identifiers as strings when possible.

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.