Format, check or minify JSON. Runs on your device.
You usually land here because a program has refused a JSON file: a config file that will not load, or a request body that an API rejects with a vague message such as unexpected token. This page opens in Check only, so it does one job. Paste the text or load the file, and it says Valid JSON, or it gives you the line and the column of the first problem. A position such as line 3, column 14 means the third line of your text and the fourteenth character along it. Under the message you see that line with a caret under the character, and the Show in the text button puts the cursor there. Most errors come from five causes: a trailing comma, single quotes, an unquoted key, a comment, and a missing comma between two values. Each has its own message that says what to change. The check covers syntax only. It does not test your data against a schema, so valid JSON can still be wrong for the program that reads it.
The checker follows RFC 8259, the standard definition of JSON. Strings and object keys use double quotes. Comments are not allowed, and neither is a comma after the last item. Any single value can stand alone at the top level, so 42, "hi" and null are valid JSON on their own, and so are objects and lists. The page reports the first problem it finds, with the line and column, and says in plain words what is wrong. It does not repair anything. A text with single quotes, unquoted keys, a trailing comma or a comment is reported as an error, even when JavaScript or a looser format such as JSON5 would accept it. The same goes for a bare word such as undefined or NaN. Only true, false and null can be written without quotes.
An error reads like Invalid JSON at line 3, column 14, followed by a reason. Under it the page shows the line that holds the problem and a caret (^) under the character where the checker stopped. Take a text whose third line is a list ending in 2 and a comma before the closing bracket: the checker stops at that bracket, line 3, column 14. Columns count characters, not bytes, so an emoji counts as one, and a tab counts as one too. The caret line replaces each tab with one space so the caret stays under the right character. A very long line is cut to a window of 80 characters around the problem. Press Show in the text to put the cursor on that character in the box above. The checker stops at the first error, so fix it and the next one, if there is one, appears.
Formatting changes only spaces and line breaks. Every number, string and name is copied exactly as you wrote it, and so are the order of keys and any repeated keys. Many formatters parse the text and print it again, which rewrites the data: 12345678901234567890 would come out as 12345678901234567000, and 1.0 as 1, because JavaScript numbers cannot hold every digit. This page does not parse the numbers at all, so 12345678901234567890, 1.0 and 1E3 stay as they are, and an escape such as \u00e9 is not turned into the letter. Minify does the opposite of Format: it removes every space and line break between the parts, and nothing else. The data is the same before and after. It does not compress the text, it does not hide it, and it does not sort keys or remove repeated ones.
You can paste or type up to 2,097,152 characters, or load one UTF-8 text file of up to 2 MB. The file does not need to end in .json; it is judged by its content. Indented output is built only when it would be 10,000,000 characters or fewer. A deeply nested text can be small and still become huge when indented, because every level adds spaces to every line below it. When that happens the page says so and suggests Minify or Check only. The box shows the first 100,000 characters of a long output, and Copy and Download give all of it. Nothing is uploaded and the text is not stored: close the tab and it is gone. The page counts visits with Google Analytics, using only the name of the tool and the fact that a result appeared, and no text is in those counts.
It is the third line of your text and the fourteenth character on that line, counting from 1. A tab counts as one character, and so does an emoji. The line is shown under the message with a caret on the character, so you do not have to count.
A trailing comma before ] or }, single quotes around a string or key, a key without quotes, a // or /* comment, and a missing comma between two values. Each one gets its own message. It stops at the first error, so fix that one and check again for the next.
No. The check is for syntax only. A text such as {"age":"abc"} is valid JSON even if your program expects a number there. This page does not know your schema, so it cannot tell you a field is missing or has the wrong type.
JSON is a stricter format than JavaScript. A comma after the last item, as in [1,2,], is valid in a JavaScript list but not in JSON, so most programs that read JSON reject it. The checker reports it as an error at the closing bracket and tells you to remove the comma.
No. A number is copied as written, so 12345678901234567890 stays 12345678901234567890 and 1.0 stays 1.0. A formatter that parses and prints the data would show 12345678901234567000 and 1, because it has to turn the digits into a JavaScript number first.
No. Keys stay in the order you wrote them, and a repeated key such as {"a":1,"a":2} keeps both members. The text counts as valid, and the Keys tile counts the repeated name twice.
No. A // or /* comment is reported as an error at the line and column where it starts, and so are single quotes and unquoted keys. Remove the comment or convert the file to plain JSON first. The page never edits your text for you.
You can paste up to 2,097,152 characters or load a file of up to 2 MB. Indented output over 10,000,000 characters is not built, which can happen with a deeply nested list of 1,000 levels. Minify and Check only still work then.
No. The text is read and checked in this tab. It is not sent anywhere, put in the page address or stored; the only things the page remembers are the Output and Indent choices. A file you load is read on your device and its name is not shown or kept.