Free tool · Nothing uploaded
JSON formatter
Format, minify and validate — and when it is invalid, the exact line and column with a caret under it and a sentence naming the mistake. Browsers do not give you that for the errors people actually make, so this works it out itself.
Why the error message here is different
Paste broken JSON into a browser console and you get one of two things. For some mistakes: "Expected double-quoted property name in JSON at position 22 (line 4 column 1)" — useful. For others, including the most common ones: "Unexpected token ''', ...'"b": 'two'' is not valid JSON" — a snippet, and no position at all.
Which mistakes fall into which bucket differs between V8, Firefox and Safari. A tool that reads the position out of that message therefore works for some errors, in some browsers, and silently does not the rest of the time — which is worse than not offering it, because it looks like it works.
So this page does not read the browser's message for the position. It scans the document against the JSON grammar itself and reports where the first violation is. Same answer in every browser, and it can say what it expected there rather than what it tripped over. The scanner was checked against JSON.parse on 45 documents, valid and invalid, with no disagreement about which is which.
The three mistakes that account for most of it
Nearly every hand-edited JSON failure is one of these, and all three are valid JavaScript — which is exactly why they slip through.
A trailing comma
{"a": 1, "b": 2,}. Perfectly fine in a JavaScript object literal and forbidden in JSON. It is the most common one by a distance, because it survives every edit that adds or removes the last entry.
Single quotes
{'a': 1}. JSON strings — keys included — must be double quoted. There is no option and no dialect where this is allowed.
An unquoted key
{a: 1}. Again ordinary JavaScript, and again not JSON. Every key is a string, even when it is a plain word with no spaces in it.
Two more that catch people less often but are harder to spot: NaN and Infinity are not JSON values (use null), and comments are not allowed — no //, no /* */. That last one is why JSON5, JSONC and YAML exist.
Why "nothing is uploaded" matters here specifically
More than for most tools on this site. The JSON people paste into a formatter is almost never a toy: it is an API response caught mid-debug, and it routinely contains bearer tokens, session identifiers, customer email addresses, internal IDs and the shape of a private schema.
A formatter that posts that to a server has been handed all of it. Nothing here leaves the page — and you do not have to take that on faith, because the Network tab settles it in two minutes for this tool or any other.
Questions
Why is my trailing comma an error?
Because JSON's grammar has no trailing commas, while JavaScript's does. The text looks right in an editor and only fails when something parses it as JSON.
Can JSON keys use single quotes?
No. Every JSON string, including every key, must use double quotes. Single quotes are valid JavaScript and invalid JSON, and this is the second most common reason a hand-edited file stops parsing.
Can I put comments in JSON?
No. Not //, not /* */. If you need comments in a config file, that file wants to be JSON5, JSONC or YAML. If it has to stay JSON, the usual workaround is a key such as _comment, which is ugly and at least parses.
Does sorting keys change anything?
No — object keys have no defined order. Arrays are never reordered, because their order is the data.
Is my JSON sent anywhere?
No. It runs entirely in your browser, which matters here because API responses tend to carry tokens and customer data.
More tools
- Number base converterBinary, octal, decimal, hex and any base to 36 — in BigInt, so a 64-bit id converts exactly instead of quietly losing its last digit the way parseInt does.
- Colour contrast checkerThe ratio, the AA and AAA verdicts, HEX/RGB/HSL conversion — and the nearest shade of your own colour that passes, so a failure arrives with a fix.
- Base64 & URL encoderBoth directions, with correct UTF-8 — a plain btoa throws on Arabic and emoji and quietly returns a different string for an accent. Both fixed here.
- Age calculatorExact age in years, months and days — worked out on the calendar rather than by dividing by 365 — with the Hijri date and the next birthday.
- BMI calculatorYour BMI on both the WHO international thresholds and the Asian cut-offs, where the risk starts lower — plus your healthy weight range in kg. Most calculators show only the first.
- Car & home financeConventional instalments, Ijarah and Diminishing Musharakah worked out as they actually are — not one EMI printed under three headings, which is what every other calculator does.
All free, all running entirely in your browser. Built by Maxverse Lab, a remote software studio. Every tool.