LocalExcelTool
Get started

JSON Formatter

Beautify JSON with 2-space indentation, right in your browser.

What is JSON Formatter

JSON formatting adds line breaks and indentation to minified JSON, making it readable. Useful for inspecting config files and API responses.

🔒 Everything runs in your browser. Nothing is uploaded.

What this tool actually does with your file

Where it runs
In your browser, on this page
Upload
None — the file never leaves your device
Offline
Works with the network disconnected

Parsing first, printing second

The input is passed through JSON.parse and re-serialised with two-space indentation. Because it is a real parse rather than a text reformatter, anything JSON does not allow is rejected with a position — trailing commas, comments, single-quoted strings, unquoted keys, and NaN all fail here even though JavaScript source accepts them.

The error message names a character offset, which is the practical way to find the problem: count to that offset in the original string. Most failures are a trailing comma before a closing brace, or a smart quote introduced by a word processor when the payload was copied out of a document.

What the round trip silently changes

Comments are gone, because JSON has no comments — if the source used JSONC or JSON5, they are not recoverable from the output. Duplicate keys collapse to the last occurrence. Key order is preserved for string keys, but integer-like keys are reordered first, since JavaScript objects treat them as array indices.

Numbers are the dangerous part. Anything beyond 2^53 loses precision: 12345678901234567890 comes back as 12345678901234567000. Snowflake IDs, Twitter/X IDs, database bigints and Ethereum wei values are all in that range, and the corruption is silent. If the payload carries large integers, treat them as strings at the source rather than reformatting them here.

Formatting is not validation

A document that parses is syntactically valid JSON, not correct data. Duplicate keys, wrong types, missing required fields and a number where a string was expected all pass. If you need schema checking, that is a separate step with a JSON Schema validator.

The practical limit is size: parsing builds the entire object in memory, so a multi-megabyte document is fine and a hundred-megabyte one will freeze the tab. For files that large, use a streaming formatter rather than a browser page.

How to use

  1. 1.Paste your JSON
  2. 2.Click Format
  3. 3.Copy the result

How this compares

There are three ways to do this conversion: in the browser (this page), through a server-side converter, or with a desktop app. The useful difference is not speed — it is where your file goes and how far the free tier actually reaches.

AspectThis toolUpload-based converters
Where the file is processedIn your browser, on this pageOn the vendor's servers, after an upload
Account requiredNoUsually — free tiers ask you to sign in before lifting a limit
Size you can process for freeNo size cap, no run limitA few files per hour, or a ~5–10 MB cap before a paywall
PriceFree. Pro is $9/month, and only buys larger files and AI featuresUsually a subscription — roughly $7–15/month as of November 2026
Works offlineYes, once the page has loadedNo
Time before work starts on a 20 MB fileImmediate — there is nothing to uploadDominated by the upload — about 16 s on a 10 Mbps uplink
What it cannot preserveInvalid input returns the parser error position instead of a repaired fileThe same — the conversion is the same maths

Server-side converters are genuinely better at some things: very large files, sharing results with a team, keeping a conversion history, and automating batches from a script. For the case in front of you — one file, one format change, right now — they mostly add an upload wait and a sign-up form.

Frequently asked questions

What is JSON formatting?

It adds line breaks and indentation to make JSON readable.

What about invalid JSON?

A syntax error message is shown if the JSON is malformed.

Is data uploaded?

No, everything runs in your browser.

What this kind of conversion cannot keep

Formatters parse the input into a tree and print it back with consistent indentation. If the input is invalid, you get the parser's error position instead of a silently mangled file — malformed JSON stays malformed rather than being «repaired» into something that is no longer yours.

More in Format