JSON Formatter & Validator

Validate JSON, see exactly where it breaks, and fix common mistakes in one pass.

Output options

JSONinput

Empty

JSONoutput

JSON output appears here

Runs entirely in your browser, so nothing is uploaded. Fair-use limits apply (5 MB per input, rate-limited conversions) to prevent spam and bots.

Load from URL

The file is fetched directly by your browser, so the server must allow cross-origin requests.

Keyboard shortcuts

Ctrl / ⌘ + Enter Convert now
Ctrl / ⌘ + S Download the output
Alt + Shift + C Copy the output
Alt + Shift + F Fix and format the JSON input
Alt + Shift + S Swap direction
Alt + Shift + T Cycle through code, tree and map views
Ctrl / ⌘ + Z Undo, including Format, Fix and Clear
Esc Leave full screen
Editor text size

Fix common JSON mistakes in one pass

Config files, JavaScript objects and copied log lines are often almost-JSON. Lenient parsing reads them, and the output is strict JSON.

Input (invalid JSON)
{
  // comments are not allowed in JSON
  name: 'web-api',
  "ports": [80, 443,],
  "debug": false,
}
Output (valid JSON)
{
  "name": "web-api",
  "ports": [
    80,
    443
  ],
  "debug": false
}

The JSON errors you will meet most

Turn off Lenient JSON to check a file against the strict standard (RFC 8259). These are the mistakes it flags most often.

ErrorExampleFix
Trailing comma [1, 2, 3,] Delete the comma after the last item.
Single quotes {'name': 'app'} Use double quotes for keys and strings.
Unquoted key {port: 8080} Wrap every key in double quotes.
Comment // note or /* note */ Remove it, or keep the note in a "comment" key.
Missing comma {"a": 1 "b": 2} Separate members and items with commas.
Unescaped quote "say "hi"" Escape inner quotes as \".
NaN, Infinity, undefined {"ratio": NaN} Use null or a string; JSON only has finite numbers.

Built for real-world JSON

Pretty-print or minify

Indent with 2, 4 or 8 spaces for reading, or minify to a single line for payloads and environment variables.

Stable key order

Sort keys alphabetically at every level so two versions of a file produce a clean, readable diff.

Exact error locations

Errors are explained in plain words with the line and column, and the line is highlighted in the editor.

Big numbers stay exact

64-bit IDs such as 9223372036854775807 keep every digit, where many formatters silently round them.

Large files

Inputs up to 5 MB are supported. Above 512 KB, formatting waits for the Format button to keep typing smooth.

More tools

Converters, validators and step-by-step guides for every place JSON and YAML meet.

Frequently asked questions

How do I format JSON online?

Paste or upload your JSON. A pretty-printed version appears on the right, indented with 2, 4 or 8 spaces. Turn on Minify for a single-line version, or Sort keys for a stable, diff-friendly order. Then copy or download the result.

How do I validate JSON?

Paste it into the editor. The status badge shows Valid JSON or Invalid JSON as you type, and an invalid document gets a plain-language error with the exact line and column. Go to error moves the cursor to the problem.

Can it fix broken JSON automatically?

Yes, for the most common mistakes. With Lenient JSON on, comments, trailing commas, single-quoted strings and unquoted keys are accepted, and the output on the right is strict, valid JSON. Copy the output to use the fixed version.

Does formatting change my data?

No. Only whitespace and, if you choose, key order change. Numbers keep their value; integers larger than 2^53, such as 64-bit IDs, keep every digit instead of being rounded.

Is my JSON sent to a server?

No. Formatting and validation run locally in your browser. Nothing you paste is uploaded, logged or stored.

Can I format JSON Lines (NDJSON)?

Yes. A file with one JSON value per line is detected automatically and combined into a single formatted JSON array, which is easier to read and to diff.