JSON Formatter

Pretty-print JSON with 2, 4 spaces or tabs. Keeps big numbers and strings exactly as written and flags duplicate keys. Runs entirely in your browser.

Options

Input

Up to 5 MiB. The file is not uploaded: it is read in your browser.

Ctrl + Enter to run

Result

The JSON formatter turns compact or messy JSON into indented, readable text. Unlike many formatters built on JSON.parse, it keeps the original text of every number and string: an ID such as 12345678901234567890 is not rounded and escapes like \u00e9 stay exactly as written.

It also flags duplicate keys, because every parser decides differently which one to keep, and numbers that JavaScript cannot represent exactly.

How to use it

  1. Paste your JSON or open a local .json file.
  2. Pick the indentation: 2 spaces, 4 spaces or tab.
  3. Press Run (or Ctrl + Enter). Syntax errors show the line and column.
  4. Copy or download the result.

Example

Example input
{"id":12345678901234567890,"name":"Ana Pérez","active":true,"tags":["admin","beta"],"profile":{"city":"Sevilla","score":4.75,"manager":null}}
Result
{
  "id": 12345678901234567890,
  "name": "Ana Pérez",
  "active": true,
  "tags": [
    "admin",
    "beta"
  ],
  "profile": {
    "city": "Sevilla",
    "score": 4.75,
    "manager": null
  }
}

Limitations

  • Strict JSON only (RFC 8259): no comments, trailing commas or single quotes. Remove JSON5/JSONC extensions first.
  • Limit of 5 MiB on desktop, 2 MiB on mobile, and 100 nesting levels.
  • The formatter never reorders keys or removes duplicates: it only warns about them.

FAQ

Is my JSON sent to a server?
No. Parsing happens in a worker inside your browser and the content is neither stored nor added to the URL.
Why does my long number stay unchanged, unlike other tools?
Because the output reuses the exact text of each number. A JavaScript double is only exact up to 2^53 − 1; the tool warns you when a number exceeds that range so you can treat it as a string or BigInt in your code.
What happens with repeated keys?
The JSON is formatted anyway, keeping both, and a warning shows the key path. RFC 8259 says names should be unique and duplicate handling is unpredictable across parsers.

Related tools

References