Menu

Language

Units

Changes the symbol and formatting. It does not convert amounts.

Theme

Suggest a tool

JSON formatter and validator

Paste the JSON, pick an indent, done. If something is off we tell you exactly where, and how many keys and how deep it goes.

Code Formats and data No sign-up

Your figures

Everything runs in your browser. Nothing is sent to a server.

Result

Result
{
  "name": "Ada",
  "active": true,
  "languages": [
    "JS",
    "TS"
  ],
  "profile": {
    "role": "dev",
    "years": 3
  }
}
Keys
6
Nesting levels
2
Lines
12
Size (bytes)
132
Difference from what you pasted
-51.7%

What we assume

  • Everything happens in your browser. The JSON never leaves your machine and is not stored anywhere.
  • It is checked against strict JSON (RFC 8259): double quotes, no trailing commas, no comments. What your editor accepts is not always valid JSON.
  • Key order is preserved exactly as it came in; nothing is sorted alphabetically.
  • Size is measured in UTF-8 bytes, which is what it actually costs to send over the wire, not in characters.
  • Numbers are rewritten the way JavaScript reads them: 1.50 becomes 1.5, and very long integers can lose precision.

How it is calculated

The JSON is parsed by the browser's own engine and written back out with the indent you choose. That means two things: if it formats, it is valid, and what you get back is canonical JSON rather than your text with the spacing changed.

Why sometimes more than the spacing changes

Rewriting normalises number notation and resolves string escapes. 1.50 comes back as 1.5: the same data, written the one way JSON considers canonical.

The precision limit

JavaScript stores numbers as double-precision floats, so an integer longer than about 16 digits can come back rounded. If you work with long identifiers, send them as quoted strings — which is what APIs that take this seriously already do.

The number worth watching

More than the output, look at nesting levels. Past four or five, a JSON payload stops being comfortable to consume and usually means the response is modelling more than it needs to.

An example

Pasting {"a":1,"b":[1,2]} with a 2-space indent gives 7 lines, 2 keys and 2 levels. Switch to minify and the same content returns on one line, with the size difference telling you what the whitespace was costing.

Frequently asked questions

Is my JSON sent to a server?

No. The site is static and the parsing is done by your own browser. You can check: open the network tab in developer tools and format something — no request goes out.

Why does it say invalid when my editor accepts it?

Almost always one of three things: single quotes instead of double, a trailing comma before a } or ], or comments. Strict JSON allows none of them, even though JavaScript, JSON5 and your editor do.

Can I sort the keys alphabetically?

Not yet. Original order is kept on purpose, because in many config formats the order carries meaning. If you need sorting, tell us and we will add it as an option.

What happens to very large numbers?

They are rewritten with JavaScript precision, which is 53 bits. A 19-digit identifier can come back with its last digit changed. For those, send them as a string.

Keep calculating

All tools →

Updated on 2026-09-02. Calculations run in your browser; nothing you type is sent to a server.

move · open · Esc close Missing one?