📦

JSON Formatter

Format, validate, minify and compare JSON instantly. Pinpoints syntax errors with line numbers, and never uploads your data anywhere.

✓ Free forever✓ No signup✓ 100% private — runs in your browser
JSON Formatter & Validator
Format, validate, minify, compare and explore JSON. Supports files up to 10MB.
Format
Compare
Tree View
Query (jq-like)
Input JSON
Output
Formatted output appears here…

Minified JSON from an API response is effectively unreadable — one line, no whitespace, thousands of characters. Formatting it with consistent indentation turns it into something you can actually navigate, and validating it tells you precisely where a malformed payload breaks.

How to use the JSON Formatter

  1. Paste your JSON into the input box
  2. Click Format to beautify it, or Minify to strip whitespace
  3. If the JSON is invalid, read the error — it names the position of the problem
  4. Copy the result, or switch tabs to compare two documents

The JSON syntax rules people trip over

Almost every parse error comes from one of four things:

  • Trailing commas. {"a": 1,} is valid JavaScript and invalid JSON. This is the single most common error.
  • Single quotes. JSON requires double quotes for both keys and string values. {'a': 1} is not JSON.
  • Unquoted keys. {a: 1} is a JavaScript object literal, not JSON.
  • Comments. JSON has none. // and /* */ both cause a parse failure.

JSON also has no date type — dates are strings by convention, usually ISO 8601 — and no trailing-comma tolerance regardless of which parser you use.

Formatting versus minifying

Format adds indentation and line breaks so humans can read the structure. Use it while debugging, and in files people edit by hand such as package.json or config.

Minify strips every optional byte of whitespace. Use it for anything transmitted over a network or stored at volume — on a large payload it routinely saves 15–30%, and the parser does not care either way.

Whitespace carries no meaning in JSON, so the two forms are exactly equivalent to any parser. The choice is purely about whether a human or a wire is the consumer.

Frequently asked questions

Is my JSON sent to a server?

No. Parsing and formatting happen entirely in your browser. This matters because API responses routinely contain tokens, personal data and internal identifiers.

Why does my JSON fail to parse when it looks correct?

Check for a trailing comma after the last item, single quotes instead of double, unquoted keys, or comments. Those four account for the large majority of parse failures.

What indentation should I use?

Two spaces is the most common convention and what most formatters default to. Four is also widely used. Tabs are valid JSON but unusual in practice.

Does formatting change my data?

No. Only whitespace changes. Keys, values, types and ordering are all preserved exactly.

Can it handle very large files?

Up to a few megabytes comfortably. Beyond that the browser will slow noticeably, since the entire document is parsed into memory at once.