Developer Tools

JSON Formatter – Validate, Beautify & Minify JSON Instantly

Format, minify and validate JSON, with clear error messages that point to the exact line and column.

Paste your JSON and get clean, readable output in one click. This free JSON formatter works entirely in your browser, so nothing you paste is uploaded.

Your JSON never leaves your device

Options
Indentation
Checks automatically as you type

 

Result
Your formatted JSON will appear here...

 

What is JSON formatting, and why is it useful?

JSON is the most common format for sending data between apps and APIs, but it often arrives as one long, unreadable line. JSON formatting, also called beautifying or pretty-printing, adds line breaks and indentation so the structure is easy to follow. That makes it far quicker to spot a missing value, compare two responses or understand a config file. Formatting also validates your JSON along the way, so mistakes are caught before they reach your code.

Pretty-Printing vs. Minifying

Pretty-print (Format JSON)

Adds line breaks and indentation so every key, array and nested object sits on its own line. Choose 2 spaces, 4 spaces or tabs. Best for reading, debugging, code reviews and documentation.

Minify (compact single line)

Removes every space and line break that isn't part of your data, leaving one compact line. Best for API requests, config values, storage and anywhere a smaller payload helps.

Both produce exactly the same data. Only the whitespace differs, so you can switch between them as often as you like.

JSON Validation and Common Errors

Validation checks that your text follows the JSON rules exactly. If it doesn't, you get a plain-English message with the line and column of the first problem, plus the offending line with the character marked. These are the mistakes that come up most often.

Trailing commas

A comma after the last item, as in [1, 2,], is allowed in JavaScript but not in JSON. Turn on "Remove trailing commas" to fix it automatically.

Single quotes

JSON strings and property names must use double quotes. 'name' is invalid; "name" is correct.

Unquoted property names

Keys must always be wrapped in double quotes. {name: 1} works in JavaScript, but JSON needs {"name": 1}.

Missing commas or brackets

Forgetting a comma between items, or leaving an array or object unclosed, are the most common mistakes. The error message points to the exact line and column.

Comments

Standard JSON has no comments. Lines starting with // or blocks inside /* */ need to be removed before the data is valid.

Invalid values

undefined, NaN and Infinity aren't JSON values, and numbers can't have leading zeros (01) or end in a decimal point (1.). Use null or a plain number instead.

Your Data Stays on Your Device

Everything on this page runs in your browser. Your JSON is never uploaded, logged or stored, which matters when it contains API responses, tokens, customer records or internal config. It's also fast, because there's no waiting on a server, and it keeps working even if your connection drops after the page has loaded.

Frequently Asked Questions

Is my JSON uploaded or stored anywhere?
No. Formatting, minifying and validating all happen in your browser. Your JSON is never sent to a server and isn't saved, so it disappears when you refresh or close the page.
What's the difference between Format and Minify?
Format adds indentation and line breaks to make JSON easy to read. Minify removes all unnecessary whitespace to produce one compact line. Both keep exactly the same data.
Why does my JSON say it's invalid when it works in JavaScript?
JavaScript is more relaxed than JSON. Single quotes, unquoted keys, trailing commas and comments are all fine in JavaScript code but not in JSON. The error message shows the line and column of the first problem it finds.
What does "Remove trailing commas" do?
With it on, a comma before a closing } or ] is accepted and left out of the result. With it off, a trailing comma is reported as an error, which is what strict JSON parsers do.
Will formatting change my data?
No. Numbers and strings are kept exactly as you wrote them, so very large numbers don't lose digits. Key order is only changed if you turn on "Sort keys alphabetically", and arrays are never reordered.
What does the Tree view do?
After you format or minify, switch the result to Tree to browse it as collapsible nodes. Expand all and Collapse all open or close every level at once. Very large documents are shown as text only.
Is there a size limit?
The site doesn't set one. Because everything runs on your device, the practical limit is your browser's memory. Documents of several megabytes format in a fraction of a second on most computers.