To format JSON online, paste it or drop the .json file above: it is indented at once (2 spaces, 4 spaces or tab), or compacted onto one line, with optional key sorting. If the JSON is broken, the verdict gives the line and column of the first error and a plain explanation. Everything runs in your browser — an API response or a config full of tokens is not uploaded — and files up to 50 MB are accepted.
The 5 mistakes that break JSON, and what the tool says
| Mistake | Example | Message shown |
|---|---|---|
| Trailing comma | [1, 2,] or {"a": 1,} | Extra comma before the closing bracket: JSON does not allow it. (position: the comma itself) |
| Single quotes | {'a': 1} | JSON requires double quotes ", not single quotes '. |
| Comment | "a": 1, // note | Comments are not allowed in JSON. |
| Key without quotes | {a: 1} | Key names must be in double quotes. |
| Missing comma | "a": 1 on one line, "b": 2 on the next | A comma is missing between two items. (position: the start of the next item) |
Each message comes with "line X, column Y" and a Go to error button that puts the cursor there. For the first four, a Repair button rewrites the JSON in strict form (comments are dropped, not kept). A missing comma has no automatic repair: fix it by hand. Other messages you may meet: an unclosed string, a text that ends too early (a closing brace or bracket is missing), content after the end of the JSON, a number such as 012 with a leading zero, or an unescaped tab or line break inside a string.
Strict JSON, JSON5 and JSONC
Standard JSON accepts none of the five mistakes above. Two relaxed variants exist: JSONC (JSON with comments, and often trailing commas) is used in some editor and project configuration files, and JSON5 also allows single quotes and keys without quotes. A program expecting plain JSON, such as most APIs and `JSON.parse`, rejects both.
This tool checks and writes strict JSON. Paste a JSONC or JSON5 file and it reports the first relaxed feature as an error; click Repair to get strict JSON, then keep a separate copy if you want to keep your comments.
Two silent traps, tested on the page: a duplicated key ({"a":1,"a":2}) is not reported, the last value wins; and an integer too large for JavaScript, such as 12345678901234567890, comes out as 12345678901234567000 (and 1.0 becomes 1). Check big identifiers before replacing a file.
Formatting options, size and privacy
- Indentation: 2 spaces, 4 spaces, tab, or minified (one line). The downloaded file ends in .min.json when minified.
- Sort keys: in the advanced options, alphabetical at every level — handy to compare two versions of a config.
- Size: files up to 50 MB. A 5 MB test file (60,000 records) was validated in about 1.4 seconds; above 1,000,000 characters the boxes show only an excerpt, the download contains everything.
- Private: the content you paste or drop is processed in your browser and never sent. The site only counts anonymous page views and events; in our test, no request carried the JSON. Tokens, API keys and passwords in your configuration stay on your device.
- Next step: JSON to CSV for a spreadsheet, CSV to JSON the other way, JSON to YAML for a config, or the YAML validator for the YAML side.
- To go between CSV, JSON, XML and YAML in any direction, use the Data converter.