JSON Formatter and Validator
Format, validate and minify JSON in your browser. Get the exact line and column of a syntax error instead of a vague parse failure.

A JSON formatter parses raw JSON and re-prints it with consistent indentation, or minifies it to strip every byte of whitespace. If the JSON is invalid it reports the exact line and column of the failure instead of a vague parse error.
Runs entirely in your browser · no signup · nothing is uploaded · updated 2026-08-29
How to use it
- 1.Paste raw JSON into the editor.
- 2.Choose an indent, or minify to strip every byte of whitespace.
- 3.Invalid JSON reports the exact position of the problem so you can fix it.
Why JSON fails to parse
Almost every parse error is one of these. JSON is far stricter than JavaScript object syntax.
| Invalid | Valid | Why |
|---|---|---|
| {'a': 1} | {"a": 1} | Strings and keys must use double quotes |
| {a: 1} | {"a": 1} | Keys must be quoted |
| {"a": 1,} | {"a": 1} | No trailing commas |
| {"a": 'x'} | {"a": "x"} | No single-quoted strings |
| // comment | (remove it) | JSON has no comment syntax |
| {"a": undefined} | {"a": null} | undefined is not a JSON value |
| {"a": 01} | {"a": 1} | No leading zeros on numbers |
| {"a": .5} | {"a": 0.5} | A number needs a leading digit |
| {"a": NaN} | {"a": null} | NaN and Infinity are not valid JSON |
Frequently asked questions
Is my JSON uploaded anywhere?
No. Parsing and formatting run in your browser with the native JSON API. Nothing is sent to a server.
Why does my JSON fail to parse?
Almost always one of three things: a trailing comma, single quotes instead of double quotes, or an unescaped newline inside a string. JSON allows none of them.
What indent should I use?
Two spaces is the common default for config and API payloads. Use minified output for anything you transmit - it is usually 15 to 30% smaller.
Does formatting change my data?
No, but key order is preserved and duplicate keys collapse to the last value, which is standard JSON.parse behaviour.
What is the difference between JSON and JSON5?
JSON5 allows comments, trailing commas, single quotes and unquoted keys. It is convenient for config files and rejected by every standard JSON parser, including this one.
Can JSON have comments?
No. The specification has no comment syntax. Config formats that appear to allow them (tsconfig, VS Code settings) use JSONC, a superset their own parsers handle.
Why do my large numbers change when formatted?
JavaScript parses all numbers as 64-bit floats, so integers above 2^53 lose precision. If your API returns large IDs, have it send them as strings.
How do I format JSON from the command line?
Pipe it through jq: curl -s url | jq . formats and colourises. Node also has it built in: node -e "console.log(JSON.stringify(require('./f.json'),null,2))".
The guide behind this tool
CSV to JSON: converting without corrupting data
Why CSV parsing is harder than splitting on commas, what nesting does to a conversion, and the type coercion that quietly destroys zip codes and IDs.
Unix timestamps: seconds, timezones and 2038
What a Unix timestamp counts, how to tell seconds from milliseconds, why leap seconds are ignored, and how to store dates without a timezone bug.
How to decode a JWT (and what every claim actually means)
Decode a JSON Web Token by hand or in the browser, understand every registered claim, and know exactly why decoding is not the same as verifying.
Tools that pair with this one
CSV to JSON
Turn a CSV into an array of JSON objects in your browser, with proper handling of quoted fields, embedded commas and custom delimiters.
JSON to CSV
Convert a JSON array into a CSV you can open in Excel or Google Sheets, with headers taken from every key that appears.
Password Generator
Generate strong random passwords in your browser using the Web Crypto API, with an entropy figure so you can see how strong they actually are.
JWT Decoder
Paste a JSON Web Token to decode its header and payload and read every claim, including expiry. Runs entirely in your browser.
Built something?
RankCert is a weekly launch board where products rank on domain control we verify ourselves - not upvotes. Listing is free and the link is dofollow whether or not you display our badge.