Skip to content
Owais Khan Software Reviews

JSON Formatter

Format, validate, minify and repair JSON. Your JSON never leaves your browser.

Format JSON

Valid JSON — 17 keys, 6 objects, 1 array, 4 levels deep.

  • $.order.id = 9007199254740993 is larger than JavaScript can hold exactly; JSON.parse would round it. Kept as written here.

A JSON validator with errors you can act on

Paste broken JSON and the JSON validator names the first problem, where it is, and what to do about it. The checker follows the JSON standard exactly and has been tested against JSONTestSuite, the collection of hundreds of edge cases JSON parsers are measured by, so what it accepts any standard parser will accept.

JSON beautifier that keeps your data exact

In the example, the order ID 9007199254740993 is one more than JavaScript can represent, and 49.90 has a trailing zero. A typical JSON beautifier passes the text through JSON.parse and hands back 9007199254740992 and 49.9. This one keeps every number and every string escape exactly as you wrote it, and warns you about IDs that other code would round.

Fix invalid JSON: trailing commas, comments, quotes

Config files, JavaScript objects and Python dictionaries look like JSON but often are not. Tick Repair to fix invalid JSON: trailing commas and comments are removed, single quotes and unquoted keys become proper double-quoted strings, and True, False and None become true, false and null. Each fix is listed, so nothing changes silently.

Frequently asked questions

How do I format JSON?
Paste your JSON or open a file. It is checked and pretty-printed as you type, with 2 spaces by default — switch to 4 spaces or tabs, or click Minify for the compact one-line form. Copy the result or download it as a .json file.
How do I find the error in my JSON?
When the JSON is invalid, the formatter shows the line and column of the first error, the line itself with a caret under the problem, and a plain explanation — "Trailing comma before }", "Property names must be in double quotes", "Missing comma between properties". Browsers each word JSON errors differently; this checker gives the same clear message everywhere.
Can it fix invalid JSON automatically?
Tick Repair. It accepts what people usually paste by mistake — trailing commas, // and /* */ comments, single-quoted strings, unquoted keys, Python’s True, False and None, NaN and hex numbers — and turns it into valid JSON, listing every change it made. It will not guess at structural damage like a missing bracket; that is reported so you can fix it where you intend.
Why do my large numbers change in other JSON tools?
Most tools run your JSON through JavaScript’s JSON.parse, which stores every number as a 64-bit float. Integers above 9,007,199,254,740,991 lose digits — the example’s order ID 9007199254740993 would become 9007199254740992 — and 49.90 becomes 49.9. This formatter never converts numbers: they are copied exactly as written, and it warns you about IDs that JavaScript code would round.
What is the difference between formatting and minifying JSON?
Formatting (pretty-printing or beautifying) adds line breaks and indentation so people can read it. Minifying removes all the whitespace that is not inside a string, giving the smallest file for APIs, config and storage. Both describe exactly the same data; switching between them never changes a value.
Is my JSON uploaded anywhere?
No. Validation and formatting run entirely as a script inside this page; your JSON never leaves your browser, and there is no upload, no API call and no analytics here — safe for API keys, tokens and customer data. That is enforced rather than promised: this site’s test suite scans the shipped HTML for every browser API capable of sending data off the page and fails the build if it finds one.