JSON Formatter
Format messy JSON into readable, indented text, minify it for production, and find syntax errors with their exact line and column. Your data never leaves your browser.
How to format and validate JSON
Paste your JSON into the input box or open a .json file from your device. The tool checks it as you type.
Choose the indentation and press Format, or press Minify to remove all unnecessary whitespace.
If the JSON is invalid, read the message and use Go to the error to jump to the exact position. Then copy or download the result.
Common JSON errors it explains
Trailing commas
{"a": 1,} is valid JavaScript but not valid JSON. The tool points at the comma that has to go.
Single quotes
{'a': 'b'} must be written {"a": "b"}. JSON only accepts double quotes for keys and strings.
Unquoted keys
{name: "Ada"} needs quotes around name. Property names are always strings in JSON.
Comments
JSON has no comments. Configuration files that use them are JSON5 or JSONC, not standard JSON.
How the formatter works
The tool reads your input with a strict parser that follows the JSON standard (RFC 8259). It never evaluates or runs the text, so pasting JSON from an untrusted source is safe. Everything happens in your browser, and nothing is uploaded or stored.
Unlike tools built on the browser's JSON.parse, numbers keep their exact original digits. Integers larger than 9,007,199,254,740,991, such as database IDs or timestamps in nanoseconds, are not rounded, and string escapes such as \u00e9 are kept as you wrote them.
When the JSON is invalid, the parser stops at the first problem and reports its line and column, an excerpt with a marker under the character, and a plain explanation of the most likely cause. Formatting rebuilds the text with the indentation you choose, minifying removes every optional space and line break, and sorting orders the keys of every object alphabetically.
Frequently asked questions
Is my JSON sent to a server?
No. Parsing, formatting and validation run entirely in your browser. Your data is not uploaded, stored or logged, so you can use it with API responses or configuration that contains private information.
What is the difference between formatting and minifying?
Formatting (also called beautifying or pretty-printing) adds line breaks and indentation so people can read the structure. Minifying removes them to make the file as small as possible for sending over a network. Both contain exactly the same data.
Why does my JSON fail here but work in JavaScript?
JavaScript object syntax is more permissive than JSON. It allows single quotes, unquoted keys, trailing commas and comments, but JSON doesn't. The error message tells you which rule was broken.
Will large numbers lose precision?
No. Numbers are copied exactly as written, so 12345678901234567890 stays 12345678901234567890. Many online formatters silently change it to 12345678901234567000.
How large a file can I format?
Files up to 50 MB can be opened. Live validation while typing is paused for inputs over about 1 MB to keep the page responsive; the Format and Minify buttons still validate the whole input.