A JSON formatter that tells you what is wrong
JSON is the text format of APIs, config files and exports: objects in curly braces, lists in square brackets, names and text in double quotes. It is easy for programs to read, but a response on one line or a file of 5,000 lines is hard for a person. This tool formats JSON so you can read it, minifies it to make it small, and validates it. When something is wrong, it does not just say "Unexpected token": it marks the line, gives the column, and explains the fix in plain words.
How to format and validate JSON
- Paste your JSON, drop a .json file on the box, or click Open file.
- Choose Format (indent of 2, 4 or tabs) or Minify, and sort the keys if you want.
- Copy or download the result, or explore it in the Tree view. If the JSON is invalid, click Show the error or Fix it.
When to use it
- Read an API response: paste the one line answer of an API or a webhook and read it as a tree.
- Find a syntax error in a config file (package.json, tsconfig.json, settings of VS Code) that a program refuses to load.
- Fix JSON written by hand or by an AI: trailing commas, single quotes, comments or missing quotes repaired in one click.
- Compare two JSON files: sort the keys of both, then paste them in a diff tool to see only the real changes.
- Minify JSON before putting it in an environment variable, a URL or a database field.
- Find the path of a value (like $.data.users[3].email) to use it in code, jq or a test.
Frequently asked questions
How do I check if my JSON is valid?
Paste it in the box or open the .json file. The check runs as you type: a green "Valid JSON" line means it is correct, otherwise you get the line and the column of the first error, the line is marked in red, and a sentence says how to fix it (for example "Trailing comma: remove the comma before }").
What are the most common JSON errors?
A comma after the last item of an object or array, single quotes instead of double quotes, property names without quotes, comments, and the Python or JavaScript values True, None, NaN and undefined. They are all valid in JavaScript or Python but not in JSON. "Fix it" repairs these automatically, and Undo brings your text back.
Does the formatter change my numbers or strings?
No. Many formatters read the JSON as JavaScript numbers, so a long ID like 12345678901234567890 becomes 12345678901234567000 without a warning. This one keeps every number and every string exactly as written, escapes like \u00e9 included. Only spaces and line breaks change, and the order of the keys if you sort them.
What is the difference between formatting and minifying JSON?
Formatting (or beautifying, pretty printing) puts each value on its own line with an indent of 2 spaces, 4 spaces or tabs, to read it easily. Minifying removes every space and line break, to make the file as small as possible for an API or a config value. The data is the same.
Can it open big JSON files?
Yes, up to 20 MB. A file of several megabytes is checked in a fraction of a second, the tree view shows big arrays by pages of 200 items, and colors are turned off above 200 KB so the page stays fast.
What does the tree view do?
It shows the JSON as folders you open and close, with the number of keys or items of each object and array. Click any value to get its path (like $.items[0].price) and copy the path or the value.
Is my JSON sent to a server?
No. The check, the formatting and the fixes happen in your browser. Your JSON is never uploaded or saved, so API responses with tokens or customer data stay on your computer.
Related tools
- Text compare: see every difference between two JSON files, after sorting their keys here.
- Base64 encoder and decoder: decode the Base64 parts of a JWT or an API response.
- CSV to Excel: open tabular data in a spreadsheet.