01 / Quotes
Double quotes only
Keys and text values go in "double quotes". Single quotes and keys without quotes are JavaScript, not JSON.
Free tool
Paste JSON or open a .json file. It is checked as you type, and a mistake is marked on its line with the exact column. Fix repairs the usual problems in JSON copied from code or an AI answer, such as comments, trailing commas, single quotes and missing commas, and lists every change it made. Browse it as a tree, search it, minify it, sort the keys, or turn it into YAML, CSV or XML. Big files open without freezing the page.
Need a custom tool, app or website? Contact us →This file is big, so it is kept out of the text box to keep the page quick. The result is on the right.
The formatted JSON shows here.
Paste on the left, open a file, or press Example to see a broken one fixed.
Comments, trailing commas, single or curly quotes, keys without quotes, missing commas between lines, True, False and None, and several objects in a row. Every change is listed, with an undo.
Options
Tree
Keys
On Windows, use Ctrl for Cmd and Alt for Option.
Your JSON is read in your browser. It is never uploaded or saved, so API keys and private data stay with you. Only your settings are remembered on this device.
The rules
01 / Quotes
Keys and text values go in "double quotes". Single quotes and keys without quotes are JavaScript, not JSON.
02 / Commas
A comma goes between items, never after the last one in a list or an object.
03 / Values
Text, numbers, true, false, null, lists and objects. No comments, no undefined, no NaN.
Guide
A JSON formatter takes JSON squashed onto one line, or laid out unevenly, and rewrites it with one value per line and even indents so you can read it. A validator checks that it follows the JSON rules and tells you where it breaks. This one does both as you type, marks the line of the first mistake in your input, repairs the common mistakes in one click with a list of what changed, and shows the result as formatted JSON, a tree, YAML or CSV.
Your settings are remembered on this device. The JSON itself is not saved anywhere: reload the page and the box is empty.
The checker reads your JSON from the start and stops at the first character that is not allowed in that spot. Take this line:
{"name": "Ada" "age": 36}
It reports line 1, column 15, "A comma is missing here, between two items". After the value "Ada" the checker needs a comma before the next key, and the arrow points just after "Ada", where the comma belongs. When the next item starts on a new line, the mistake is reported at the end of the line before, since that is where the comma goes. Here are the messages you will see most:
| Message | Usual cause |
|---|---|
| A comma is missing here, between two items | Two values or keys with no comma between them |
| Extra comma before } (or ]) | A trailing comma after the last item |
| Keys need double quotes | A key with no quotes, as in JavaScript |
| Text needs double quotes, not single quotes | Strings written with 'single quotes' |
| Curly quotes are not allowed | JSON pasted from a word processor or a chat app that changed the quotes |
| Comments are not allowed in JSON | A //, /* */ or # comment copied from a config file |
| True is Python | True, False or None from a Python print-out |
| The JSON ends too early | A missing closing bracket or brace, often from a copy that was cut short |
| Extra text after the end of the JSON | Two JSON documents pasted together, or JSON Lines with one object per line |
| Text cannot run over a line break | A string that spans two lines, or a closing quote that is missing |
JSON copied from JavaScript code, a Python print-out or an AI chat answer often looks right but breaks the rules. Fix goes through the text once, leaves everything inside strings alone, and:
//, /* */ and # comments;Afterwards a yellow box lists each kind of change with its line numbers, and those lines are marked yellow in the Input. Fix guesses what you meant, so read the marked lines before you use the result, especially where NaN or undefined became null. Undo the fix puts your text back exactly as it was. If something is still wrong after Fix, the first remaining mistake is shown.
Tree shows each object with its number of keys in braces and each list with its number of items in square brackets. The first two levels open by default; click any line to open or close it. Lists and objects with more than 100 entries are split into groups of 100, so a list of a hundred thousand items stays quick to open.
Click a key in the tree and its path appears under the tree, such as $.users[0].name, with Copy path and Copy value. The path is written the JSONPath way, so you can paste it into code or a query.
The search box finds keys and values in every view. Press Enter for the next match and Shift and Enter for the one before. In the tree, the match is opened and selected for you.
Some JSON is valid but will not come back the way it was written. The tool says so in a yellow strip above the result, with a link to each line:
Two smaller changes happen without a warning: number style is simplified, so 1.0 becomes 1 and 1e3 becomes 1000, and escapes are written out, so \u00e9 comes back as é.
The JSON is read in the background, so the page keeps responding while a big file is checked, and the result is drawn only a screen at a time, with colours, however long it is. A file over 3 MB is kept out of the Input box, which would be slow to edit, and Edit it here anyway puts it in if you need to change something. The limit is the memory of your browser tab; files up to 200 MB can be opened.
On Windows and Linux, use Ctrl for Cmd and Alt for Option.
Questions
On this page, yes: the JSON is checked and formatted by your own browser and never leaves the tab. That is not true of every online formatter, so check before you paste secrets elsewhere.
It is the browser's own message when JSON breaks: the reader met a character it did not expect at that spot. This tool reads the JSON itself and names the real problem instead, such as a missing comma, a comment or single quotes, and marks the line in your input.
It removes comments and trailing commas, adds missing commas, turns single and curly quotes into double quotes, puts quotes round bare keys, and turns True, False and None into true, false and null. It also turns undefined, NaN and Infinity into null, the nearest JSON value. Every change is listed with its line, the lines are marked, and Undo the fix puts your text back.
Files of tens of megabytes open fine, since the JSON is read in the background and only the visible part of the result is drawn. Files over 3 MB are kept out of the Input box to keep the page quick. Up to 200 MB can be opened, if your browser tab has the memory.
The same data with every space and line break that is not needed taken out, so it is smaller to send or store. Format turns it back into readable lines.
JSON is a stricter text format. Keys and strings must use double quotes, there are no comments or trailing commas, and values are limited to text, numbers, true, false, null, lists and objects. JavaScript allows all of those extras.
Whole numbers above 9,007,199,254,740,991 cannot be held exactly by a browser, so they are rounded when the JSON is read. Store long IDs as strings in quotes and they stay exact.
Yes, with one click. Several objects in a row show "Extra text after the end of the JSON", and Fix puts them inside one [ ] list with commas between, which is valid JSON you can format, browse and turn into CSV.
No. It stays in this tab and is gone when you close or reload it. Only your settings, such as the indent and the view, are remembered in this browser.
Yes. Switch the Result to YAML or CSV and press Download. CSV needs a list of objects; nested keys become columns joined with dots.
No. JSON objects have no meaningful key order, so sorting only changes how it reads. Lists keep their order, because order matters in a list.