Paste messy or minified JSON to format, validate, minify and explore it as a collapsible tree — with exact error locations, all in your browser.
$.user.address.city).True / False / None. Then Copy or Download the result.JSON (JavaScript Object Notation) is a lightweight text format for storing and exchanging data. It is the standard format for web APIs, configuration files, logs and databases such as MongoDB and PostgreSQL. It is built from just a few pieces: objects { } with named keys, arrays [ ], strings in double quotes, numbers, true, false and null.
Everything is checked in your browser. Your data is never uploaded, which makes this safe for API responses, configuration and other work data.
Trailing comma — a comma after the last item, such as {"a":1,}. Single quotes — JSON requires double quotes, so 'a' is invalid. Unquoted keys — write {"a":1}, not {a:1}. Comments — // and /* */ are not allowed. Missing comma between two items. Unescaped line break inside a string — use \n. Python values such as True, False and None must be true, false and null.
The error message shows the line, column and a pointer to the problem. Press Auto-fix & format to repair the common ones automatically; your original input is not changed.
Many formatters parse the data into JavaScript objects first, which silently changes it: numbers longer than 15 digits are rounded, 1.50 becomes 1.5, integer-like keys are re-ordered and duplicate keys disappear. This tool reads the text directly, so numbers, string escapes and key order are kept exactly as you wrote them, and duplicate keys are reported instead of being dropped. Turn on Sort keys only when you want the order changed.
Paste your JSON into the Input box. The formatted, indented result appears on the right as you type. Choose 2 spaces, 4 spaces or tab indentation, then copy the result or download it as a file.
Validation runs automatically. A green banner means the JSON is valid and shows its size and structure. A red banner shows the line and column of the first error, the reason, and the offending line with a pointer. Click Go to error to jump to it in the input.
No. Parsing, formatting and the tree view all run in your browser. Your JSON is never sent anywhere or stored, so it is safe to use with API responses and configuration files.
Press Minify. All whitespace outside strings is removed, which reduces the size for APIs, storage and URLs. The status bar shows how much smaller it became.
JavaScript object literals are more relaxed than JSON. They allow single quotes, unquoted keys, trailing commas and comments, while JSON allows none of these. Turn on Auto-fix mistakes to convert such text into valid JSON.
Yes. Numbers are copied as written, so 12345678901234567890 and 1.50 stay unchanged. Tools based on JSON.parse would round the first to 12345678901234567000 and turn the second into 1.5.
It sorts object keys alphabetically at every level, which makes two JSON files easier to compare. Arrays keep their order. Sorting is optional and only affects the output, not your input.
Files of several megabytes work fine. For very large input (over about 1.5 MB), syntax colouring is switched off to keep the page responsive; the formatting itself is unaffected. The tree view loads branches only when you open them.
JSON is a text format. Keys must be in double quotes, strings must use double quotes, and it cannot hold functions, comments, undefined or trailing commas. A JavaScript object is an in-memory value that you can convert to and from JSON with JSON.stringify() and JSON.parse().