Skip to content

Format JSON

Turn one long line of JSON into something you can read, or squeeze it back down. Large numbers keep every digit, which most online formatters quietly get wrong. Nothing leaves your device.

  • Processed on your device
  • No upload, no waiting
  • No signup, no watermark
Indent

The formatted JSON appears here.

How it works

1

Paste your JSON

Or drop a .json file in. Whatever you paste stays in this page — there is no upload.

2

Pick an indent

Two spaces, four, tabs, or minified down to a single line. The choice is remembered for next time.

3

Copy or download

Copy the result, or save it as a file. If the JSON is broken you get the line, the column and the character instead.

Frequently asked questions

Is my JSON uploaded anywhere?

No. There is no upload, no server call and no logging — the formatting happens inside this page, on your own device. You can disconnect from the internet after the page loads and it keeps working. That matters here more than it looks: the things people paste into an online JSON formatter are API responses, config files and error payloads, and those routinely carry tokens, customer records and internal hostnames.

Why does this keep large numbers exact when other formatters do not?

Because almost every other one silently breaks them. A JavaScript number is a 64-bit float, so it can only hold whole numbers up to 9,007,199,254,740,991 exactly. Anything larger — a Twitter/X post ID, a Discord snowflake, a bank account number, a 64-bit database key — loses its last digits the moment it passes through `JSON.parse`. The number still looks plausible, which is what makes it dangerous: 7205759403792793600 quietly becomes 7205759403792793000. This page keeps the digits you pasted, exactly, and tells you how many numbers it had to protect.

What does it do with a broken file?

It tells you where the problem is, not just that there is one. You get the line number, the column, the line itself with a caret under the offending character, and a description in plain words — "a trailing comma before }" rather than "Unexpected token". Trailing commas, single quotes, unquoted keys and unescaped newlines inside strings are the four that account for most broken JSON, and each is named specifically.

Does it handle JSON Lines / NDJSON?

Yes, and it keeps the shape. JSON Lines is one complete JSON value per line — the format logs and data exports use — and pretty-printing it across multiple lines would destroy the thing that makes it useful. It is detected automatically, each line is formatted on its own, and the one-value-per-line layout is preserved.

Can it fix JSON with comments or trailing commas?

It will point at them precisely, but it will not silently accept them. Comments and trailing commas are not JSON — they are JSON5 or JSONC, which is what config files like tsconfig.json actually use. A formatter that quietly accepted them would hand you a file that your parser then rejects, which is worse than an error here.

Is there a size limit?

Your device's memory rather than an upload cap. Documents of a few megabytes format instantly; very large ones are limited by how much the browser will hold, not by anything we impose.

Does minifying change my data?

No. Minifying removes only whitespace between tokens — it never reorders keys, never changes number formatting, never drops anything. The result parses to exactly the same value, just smaller.