TheDevTab
Tools

Keyboard shortcuts

Ctrl K
Search tools and guides
?
Show keyboard shortcuts
Escape
Close menus and dialogs

JSON Formatter

Paste JSON, get readable output.

This runs in your browser. Nothing is uploaded.

Drop a file here or choose oneChoose file

Common JSON errors

Trailing commas are the most common mistake. JSON does not allow a comma after the last property. JavaScript object literals often do, so copy-paste from code will fail until you remove that comma. Single quotes are the next trap: JSON strings must use double quotes. Comments are also invalid in JSON, even though JSONC and some config files allow them.

If a key is repeated, this tool follows the browser: the last value wins. That is not a pretty-printer quirk. It is how JSON.parse works. If you need to detect duplicates, you need a different parser than the one every browser ships.

Formatter, beautifier, validator, or minifier?

A formatter and a beautifier are two names for the same basic job: parse valid JSON and write it with consistent indentation. This page also has a Validate action that checks the syntax without replacing your output, and a Minify action that removes whitespace for a compact payload. Sort changes object key order when you need stable-looking output for a review. None of these actions changes the meaning of valid JSON, but sorting can make a meaningful difference to a text-based diff.

The useful sequence is simple. Paste or drop a file, read the error if parsing fails, then choose an indentation width and Format. If another system needs the smallest representation, use Minify after the document is valid. Copy the result or download it asformatted.json. The input stays visible so you can compare what changed.

Large files and browser limits

Normal JSON is parsed in the page. Larger inputs, including dropped JSON files above roughly 200 KB, can run in a Web Worker so the editor has a better chance of staying responsive. The worker still runs on your device. It does not turn the page into an upload service. A browser has finite memory, so a very large document can still take time or fail before formatting finishes. If that happens, split the file locally and work on one part at a time.

Error messages include a line and column when the browser can identify them. Jump to that location, check the character before it, and look for a missing quote, bracket, or comma. JSON syntax errors are often reported at the point where parsing becomes impossible, not at the original typo.

What this tool does not do

This is a syntax tool, not a JSON Schema validator, API contract checker, or data quality audit. It does not fetch a URL, resolve references, run JavaScript, or send your paste to a server. Valid JSON can still contain the wrong fields, unsafe values, or a secret that should not be shared. Review the content before copying it into a ticket or log.

For two valid documents, use JSON Diff to see paths that were added, removed, or changed. For an array that needs a flat export, use JSON to CSV. The guide How to format and validate JSONexplains the same workflow with examples.

FAQ

Does this JSON formatter upload my data?

No. Parsing and formatting happen in your browser. After the page loads, the tool still works if you turn on airplane mode.

What is the difference between a formatter, a beautifier, and a validator?

A formatter (also called a beautifier) rewrites JSON with consistent indentation so you can read it. A validator only checks that the text is legal JSON. This page does both, plus minify and sort keys.

Why do I get an error about a trailing comma?

Standard JSON does not allow a comma after the last property in an object or the last item in an array. Remove that extra comma and format again.

Can I format a large JSON file?

Yes. Drop a .json file onto the page. Files over about 200 KB run in a Web Worker so the tab stays responsive. Very large files can still run out of memory in the browser.

Can this tool minify JSON as well as format it?

Yes. Format adds readable indentation, while Minify removes unnecessary whitespace. Both operations parse the JSON first, so invalid input still needs to be fixed.

Does the formatter detect duplicate keys?

No. The browser JSON parser keeps the last value for a repeated key. This formatter does not claim that a document with duplicate keys is safe for every parser.