JSON Formatter and Validator

Paste JSON and get it formatted, validated or minified. The data stays in your browser — nothing is uploaded, which matters when the payload contains tokens or customer data.

How to use

  1. Paste your JSON into the input box.
  2. Choose the indentation — two spaces, four spaces or a tab — and optionally sort object keys alphabetically.
  3. Press Format to beautify, or Minify to strip every unnecessary byte.
  4. If the JSON is invalid, the message under the buttons shows what the parser expected and where it stopped.

Good to know

What the validator checks

The tool parses your text with the browser's own JSON parser, so it accepts exactly what a JavaScript application accepts — and rejects exactly what it rejects. Trailing commas, single quotes, unquoted keys, comments and NaN are all invalid JSON, even though many editors tolerate them.

Formatting versus minifying

Formatted JSON with indentation is for reading and diffing in code review. Minified JSON — no spaces, no line breaks — is for transport: it typically shrinks a payload by 15–30% before compression, which matters for API responses and config bundled into a page.

Sorting keys

JSON objects have no guaranteed order, so two exports of the same data can differ only in key order and produce a huge, meaningless diff. Sorting keys before comparing makes the real changes visible.

Frequently asked questions

Is my JSON sent to a server?

No. Parsing and formatting happen in your browser, so credentials, tokens or personal data inside the payload never leave your machine.

Why does my JSON fail validation?

The most common causes are a trailing comma before a closing brace, single quotes instead of double quotes, unquoted keys, or a stray comment. The error message shows the position where the parser gave up.

What is the largest file I can format?

The input is capped at 5 MB to keep the page responsive. Larger dumps are better handled with jq or a code editor.

Does formatting change my data?

No. Only whitespace changes — and key order, if you enable sorting. Values, types and structure stay exactly as they were.

Can I use it offline?

Yes. After the page loads you can go offline; the tool keeps working because all the logic is in the page.

Does it support JSON Lines or JSON5?

Not yet — the tool validates strict JSON as defined by RFC 8259, which is what browsers and most APIs use.

Related tools