Skip to content
All tools
English

JSON formatter and validator

Paste JSON to make it readable, find what is wrong with it, or squeeze it onto one line. It never leaves this page.

Your data never leaves your device

Paste JSON or open a .json file. It is checked as you type.

Options
Output

Or open a JSON file

or drag and drop it here

.json, .txt, .log · read on your device, never uploaded

How to use it

  1. Paste or open a file

    An API response, a config file, a log line. Files are read on your device.

  2. Choose the output

    Pretty (2 spaces, 4 spaces or tabs), minified, or a collapsible tree.

  3. Fix and copy

    If it is invalid, jump to the error, or try "Fix common mistakes". Then copy or download.

The errors people actually make

JSON is stricter than the JavaScript it came from. Most "invalid JSON" comes down to a handful of mistakes, and the validator names each one with its line and column:

  • Trailing comma: [1, 2,] or {"a": 1,}. Allowed in JavaScript, forbidden in JSON.
  • Single quotes: strings and keys must use double quotes, "like this".
  • Unquoted keys: {name: "x"} is a JavaScript object, not JSON.
  • Comments: // and /* */ are not part of JSON, although some config formats (JSONC, JSON5) accept them.
  • Python values: True, False and None must be true, false and null.

"Fix common mistakes" repairs all five in one click and then validates again, so anything it cannot fix is still pointed out exactly.

Big numbers stay exact

JavaScript numbers lose precision above 9,007,199,254,740,991. Tools built on JSON.parse silently turn an id like 12345678901234567890 into 12345678901234567000. This formatter reads numbers as text and writes them back unchanged, and warns you when a value is too big for JavaScript so you know your own code may need BigInt or strings.

When to minify

Minified JSON removes every space and line break. It is smaller to send and store, and it fits on one line in logs, environment variables and curl commands. Keep the pretty version in your repository: diffs are readable and merge conflicts are easier.

Working with tokens? Decode JWT payloads in our JWT decoder. Converting a timestamp you found in the JSON? Use the timestamp converter.

Frequently asked questions

Is my JSON uploaded anywhere?
No. Parsing and formatting run in your browser and the page is not allowed to make network requests. That makes it safe for responses containing personal data or keys.
How large a file can it handle?
Files of tens of megabytes format in a second or two on a normal computer. The tree view shows the first levels and opens deeper ones as you click, so it stays fast.
Does it support JSON5 or JSON with comments?
The validator follows standard JSON (RFC 8259) and tells you where comments or trailing commas are. "Fix common mistakes" converts JSONC/JSON5-style input into standard JSON.
Why does it warn about duplicate keys?
JSON allows them, but most parsers keep only the last value, so the first one is silently lost. It is almost always a bug.