JSON Formatter and Validator
Format, minify, validate and repair JSON. Errors show the exact line and column, and big numbers stay exact.
How it works
Paste JSON and the tool reads it with a strict parser that follows the JSON standard (RFC 8259). If it is valid you get it back neatly indented, or squeezed onto one line. If not, it tells you the line and column of the first problem and shows the line.
Turn on "Repair common mistakes" to also accept things that look like JSON but are not: comments, trailing commas, single quotes, keys without quotes, and Python True, False and None. The tool lists what it fixed. Numbers are copied as typed, so a long ID like 9007199254740993 is never rounded the way JavaScript would round it.
Worked example
Input: {name: 'Aman', marks: [78, 91,],}
Strict mode says: line 1, column 2, a key must be in double quotes.
With repair on you get {"name": "Aman", "marks": [78, 91]} and the list "unquoted keys quoted, single quotes changed to double quotes, trailing commas removed".
Good to know
- JSON allows only double quotes, no comments and no trailing commas. JSON5 and JavaScript objects allow more, so copy-pasting code into a JSON file is the most common cause of errors.
- Escape a string turns text with quotes and line breaks into one valid JSON string, ready to paste into code or a request body.
- Duplicate keys are legal to read but almost always a mistake, since most programs keep only the last. The tool warns you.
- Nothing is uploaded. Your JSON stays in your browser.
Common questions
- Why does my JSON show an error at the very end?
- Usually a bracket or brace was opened and never closed, or there is extra text after the last }. The message says which one.
- What is the difference between format, minify and check?
- Format adds line breaks and indentation so people can read it. Minify removes all spaces to make it smaller for sending. Check only validates and reports the structure.
- Does sorting keys change the meaning?
- No. Order of keys in an object has no meaning in JSON, but arrays keep their order.
- Can it handle big files?
- Yes, files of several MB work on most phones and laptops. Use Open a file to load one.
More in Data.
The full ASCII chart with decimal, hex, octal and binary codes. Search by character, number or name.
OPEN →CSV AnalyzerSee what is inside a CSV: each column's type, missing values, unique values, and min, max and average.
OPEN →CSV CleanerTidy a messy CSV: trim spaces, drop empty rows and columns, and even out short rows.
OPEN →