JSON Formatter & Validator

Format, validate & fix JSON online

Beautify messy JSON, catch errors with the exact line and column highlighted, and repair common mistakes in one click — all in your browser, nothing uploaded.

Ready — paste or type to validate

🔒 100% private — your document is processed entirely in your browser and is never uploaded, logged, or stored.

A JSON formatter that shows you exactly what’s wrong

Most online tools tell you your JSON is “invalid” and leave you hunting for the problem.Indentio pinpoints the precise line and column, underlines it in red, and explains the mistake in plain English — then offers a one-click fix. It is a formatter, validator, and repair tool in a single fast page.

That matters most in exactly the situation where you reach for a formatter: a single unreadable line, thousands of characters long, that came out of a log file or an API response. Minified JSON has no line breaks, so a parser error like“Unexpected token at position 24718” tells you nothing you can act on. Formatting first turns that position into a line you can actually navigate to.

How to use it

  1. Paste or upload your JSON, or click Sample to try it.
  2. Errors are underlined live as you type — hover the red mark for details and a fix hint.
  3. Click Format to beautify, Minify to compact, or Auto-fix to repair.
  4. Use Tree view to explore structure, then Copy or Download.

Choosing an indentation style

Indentio offers two spaces, four spaces, or tabs. None is more correct than the others — JSON’s grammar ignores whitespace entirely — but ecosystems have strong conventions, and matching the one your file lives in keeps diffs clean:

IndentConventional forNotes
2 spacespackage.json, npm and Node tooling, most web configs, Prettier’s defaultThe safest default. npm rewrites package.json with two spaces, so anything else gets reverted on the next install.
4 spacesPython (json.dumps(indent=4)), .NET, Java toolingMore readable for deeply nested documents; costs noticeably more bytes.
TabGo (json.MarshalIndent defaults), some Rust and PHP projectsOne byte per level, and each reader picks their own display width.

Indentation is not free. On a deeply nested 1 MB document, moving from two spaces to four can add 10–15% to the file size, and pretty-printing at all typically adds 15–25% over the minified form. That is irrelevant for a config file you read by hand and very relevant for something you ship over the wire on every request.

What formatting changes — and what it never touches

A JSON formatter is a parse-and-re-emit cycle, not a text transformation, so it is worth being precise about what survives the round trip:

When to minify, and when not to

Minify strips every optional space and newline, producing the most compact valid representation of the same data. It is the right choice when JSON is being transmitted or stored rather than read: API request and response bodies, values stuffed into a database column or an environment variable, and anything measured in payload size. Minifying typically reclaims the 15–25% that pretty-printing added.

It is the wrong choice for anything a human or a version-control system reads. A minified file committed to git produces a one-line diff on every change, which makes code review impossible and merge conflicts unresolvable. Keep configuration, fixtures, and test data formatted; minify at the boundary where the data leaves your repository.

One caveat worth knowing: if your transport already applies gzip or Brotli compression — as almost every HTTP server does — the practical gain from minifying JSON is much smaller than the raw byte count suggests, because repeated indentation compresses extremely well.

Common JSON mistakes it catches

Nearly every invalid JSON document in practice fails for one of a handful of reasons, and most of them come from JSON looking deceptively like JavaScript while being far stricter:

{
  'name': 'Ada',        // ✗ single quotes — JSON requires "double quotes"
  age: 36,              // ✗ unquoted key
  "tags": ["x", "y",],  // ✗ trailing comma after the last item
  "active": True,       // ✗ Python spelling; JSON uses true / false / null
  "score": NaN          // ✗ NaN and Infinity are not JSON values
}

Auto-fix handles all of the above. It is a repair pass, not a guess: it removes trailing commas, converts quotes, quotes bare keys, closes unbalanced brackets, and strips comments, then re-formats. Review the result before shipping it — a document broken badly enough can have more than one plausible repair.

Working with large files

The editor is virtualised, meaning only the visible portion of the document is rendered, so scrolling through a multi-megabyte file stays responsive. Validation, formatting, and minification all run on the main thread in your browser, so the practical ceiling is your device’s memory rather than any limit we impose.

If you are working with a genuinely huge export — hundreds of megabytes — no browser tool is the right instrument, including this one. That is the territory of streaming parsers such as jq on the command line, which never hold the whole document in memory. A formatter is for the file you need to read, not the file you need to process.

Why it runs entirely in your browser

JSON that needs debugging is very often JSON that should not be pasted into a stranger’s server: an API response containing customer records, a config file with an access token, a log line with session identifiers. Indentio parses, formats, and validates using JavaScript running on your own machine. There is no upload step, no request carrying your document, and nothing to log or retain — which also means the tool keeps working with the network disconnected. See the privacy policy for the full detail.

Go deeper

Frequently asked questions

How do I format (beautify) JSON?

Paste your JSON into the editor and click Format (or press Ctrl/⌘ + Enter). Your JSON is re-indented with 2 spaces, 4 spaces, or tabs — your choice. If anything is invalid, the exact spot is underlined in red before formatting.

What JSON errors can it detect?

Missing or extra commas, trailing commas, single quotes instead of double quotes, unquoted keys, unclosed brackets and braces, and unterminated strings — each reported with a precise line and column and a plain-English explanation.

Can it fix my broken JSON automatically?

Yes. Click Auto-fix and common problems — trailing commas, single quotes, unquoted keys, missing brackets — are repaired in place, then re-formatted. You stay in control and can review the result.

Does formatting change my data?

No. Formatting only rewrites the whitespace between tokens. Key order, string contents, and the set of keys are all preserved exactly as you pasted them. The one thing to be aware of is that numbers are re-emitted in their canonical form, so 1.50 becomes 1.5 — the value is identical, the spelling is not.

Is my JSON uploaded to a server?

No. All formatting and validation happen locally in your browser using JavaScript. Your data never leaves your device — nothing is uploaded, logged, or stored.

Is there a size limit?

There is no fixed limit. The editor is virtualized and handles large documents smoothly; very large files depend only on your device’s memory.

Can it format JSON with comments (JSONC) or trailing commas?

Strict JSON allows neither, so both are reported as errors. If you are editing a tsconfig.json, a VS Code settings file, or anything else that permits comments, use Auto-fix — it strips the comments and trailing commas and hands you portable JSON.