Free Tool

Format and validate JSON, instantly and privately

Paste messy JSON, get it back clean and readable, with the exact line and column of any error. Nothing leaves your browser.

JSON arrives minified, escaped, or subtly broken, and a missing comma buried in a thousand lines is nearly impossible to spot by eye. Most online formatters solve that by uploading your data to a server you know nothing about, which is a poor trade when the JSON holds API keys, customer records or anything else you would not paste into a stranger's website.

01

What a JSON formatter actually does

A formatter parses your JSON into a data structure and prints it back with consistent indentation, so nesting is visible and structure is obvious. Validation happens as a side effect: JSON that will not parse cannot be formatted, so the moment it fails you know something is wrong, and a good tool tells you where. This one adds line and column numbers to the parser's error, which the browser's built-in message leaves out.

02

Why doing it in the browser matters

Formatting is pure computation on text, so there is no technical reason to send your data anywhere. When a tool uploads it regardless, that data can be logged, cached or leaked, and JSON is exactly the kind of payload that carries secrets: tokens, connection strings, personal data. Running entirely in your browser means the tool physically cannot see your data, which is the only privacy guarantee worth anything.

03

Format, minify, and when to use each

Formatting expands JSON with indentation for reading and diffing. Minifying strips every optional space to make the payload as small as possible for sending over a network. You want formatted JSON in your editor and version control, and minified JSON on the wire. This tool does both from the same input, so you can check a payload and then shrink it without leaving the page.

How to use it

  1. 1

    Paste your JSON

    Drop it into the input box. It can be minified, pretty-printed, or a copy-pasted mess with inconsistent spacing. Size is not a problem.

  2. 2

    Format and validate

    Press Format. Valid JSON comes back indented and readable. If it is broken, you get the error with the line and column, so you go straight to the problem instead of hunting.

  3. 3

    Fix any error

    The most common breakages are a trailing comma, a missing quote, or a single quote where JSON demands a double. The error location points you at the character to change.

  4. 4

    Copy the result

    Use Copy to put the formatted output on your clipboard. Minify first if you need the compact version for an API call or config file.

Common mistakes

Trailing commas

JSON does not allow a comma after the last item in an object or array, even though JavaScript does. Remove it. This is the single most common cause of a parse failure.

Single quotes instead of double

JSON strings and keys must use double quotes. Single quotes are valid JavaScript but invalid JSON, and a copied JavaScript object often trips on exactly this.

Unquoted keys

Every key in a JSON object must be a quoted string. A JavaScript object literal lets you skip the quotes; JSON does not.

Comments in the file

Standard JSON has no comments. If your config file has // or /* */ in it, it is JSONC or a superset, and a strict parser will reject it. Strip the comments or use a parser that expects them.

Questions

Is my JSON uploaded anywhere?
No. The tool runs entirely in your browser using the built-in JSON parser. Your data never leaves your device, which is why it is safe to paste JSON that contains keys or personal information.
Is there a size limit?
There is no fixed limit. Because it runs locally, the only ceiling is your browser's memory, which comfortably handles files far larger than most APIs ever return.
Why does it say my JSON is invalid when it looks fine?
The usual culprits are a trailing comma, a single quote, an unquoted key, or a stray comment. The error message gives a line and column so you can go straight to it. If it still looks correct, check for an invisible character copied from a document.
What is the difference between formatting and minifying?
Formatting adds indentation to make JSON readable. Minifying removes all optional whitespace to make it as small as possible for sending over a network. Use formatted JSON while working and minified JSON in transit.
Does it work offline?
Once the page has loaded, yes. Nothing about the formatting needs a network connection, so it keeps working even if you lose signal.

Need this done properly, at scale?

The tool handles the one-off. When it's a system you're building, that's the paid version of the job, and we do that too.

Custom Website Development