Skip to content

JSON Formatter & Beautifier

Turn a minified or messy JSON document into readable, consistently indented text, with a precise error message if the JSON is invalid.

Processed locally in your browser

Options
0 chars · 0 lines
The result will appear here.

What is JSON Formatter & Beautifier?

JSON (JavaScript Object Notation) is the standard text format for APIs, configuration files and logs. API responses are usually minified on a single line, which makes them hard to read and review.

This formatter parses your JSON with a strict RFC 8259 parser and prints it again with the indentation you choose. Unlike tools built on JSON.parse followed by JSON.stringify, numbers are copied character by character, so 12345678901234567890 or 1.50 are never rounded or rewritten.

How does it work?

  1. Paste your JSON, or open a .json file; the formatted result appears instantly.
  2. Choose 2 spaces, 4 spaces, a tab or the compact one-line layout, and tick “Sort keys” if you want alphabetical order.
  3. If the JSON is invalid, the tool shows the reason with the line and column of the problem and a short excerpt.
  4. Copy the result or download it as formatted.json.

Common use cases

  • Reading a minified API response copied from the browser network tab.
  • Normalising a package.json, tsconfig or settings file before committing it, so diffs stay small.
  • Checking that IDs such as 64-bit integers survive untouched before you send a payload to another service.
  • Preparing a readable JSON sample for documentation or a bug report.

Examples

Try this input in the tool above:

Input
{"id":12345678901234567890,"name":"Ada Lovelace","tags":["math","code"],"address":{"city":"London","zip":"N1"},"scores":[1.50,2,{"bonus":null}]}
Output
{
  "id": 12345678901234567890,
  "name": "Ada Lovelace",
  "tags": [
    "math",
    "code"
  ],
  "address": {
    "city": "London",
    "zip": "N1"
  },
  "scores": [
    1.50,
    2,
    {
      "bonus": null
    }
  ]
}

Privacy

JSON Formatter & Beautifier runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

Duplicate keys are kept as written (they are valid JSON but ambiguous). Comments and trailing commas are not JSON: use JSON Repair for those.

Frequently asked questions

Does the formatter change my numbers?

No. Numbers and string escapes are copied exactly as typed. Big integers beyond 9,007,199,254,740,991 are reported with a warning because JavaScript programs that parse the JSON would round them.

How is the error line and column computed?

The parser counts lines and characters up to the first unexpected character, so you get a position such as “line 3, column 8” plus a caret excerpt of that line.

Is my JSON sent to a server?

No. Parsing and printing happen in your browser tab (in a background worker for very large files), so confidential payloads stay on your device.

More tools in JSON & Data →