JSON Formatter and Validator
Paste JSON to check it, make it easy to read, or squeeze it into one line.
Your JSON is checked in your browser and is never uploaded.
How to use the JSON formatter
- Paste your JSON into the box.
- Press Format to indent it so that each level is easy to read, or Minify to remove all extra spaces and line breaks.
- If the JSON has a mistake, you see the message of the browser and, when it is known, the line and column.
- Copy the result or download it as a .json file.
Common JSON mistakes
- A comma after the last item in a list or object. JSON does not allow it.
- Single quotes. JSON needs double quotes for keys and text.
- Keys without quotes, such as {name: "Ali"}. Write {"name": "Ali"}.
- Comments with // or /* */. Standard JSON has no comments.
- Missing commas between items, or a missing closing bracket.
- Values such as undefined, NaN or a function. JSON allows only text, numbers, true, false, null, lists and objects.
Why format or minify JSON
Formatted JSON is easy to read and compare when you debug an API response or edit a settings file. Minified JSON is smaller, which saves space and bandwidth when you send it over a network or store it. Sorting keys puts the fields in a steady order, which makes two files easier to compare. Sorting never changes the values. Be aware that some programs treat the order of keys as meaningful, so keep your original if you are unsure.
To make a printable copy use JSON to PDF, to move a list of records into a spreadsheet use JSON to CSV, and to compare two versions use Text Diff.
Questions about JSON formatting
Is my JSON sent to a server? No. It is checked by your own browser, so private data, tokens and API responses stay on your device.
Is there a size limit? No fixed limit, but very large files of many megabytes can make a browser tab slow.
Will large numbers stay the same? Numbers larger than about 9 quadrillion lose exactness in a browser. If you handle very large IDs, keep them as text in quotes.
Learn more in our guide: JSON Formatter Guide: How to Read, Validate and Fix Invalid JSON.