JSON formatter and validator

Format, minify and validate JSON. Errors are shown with the line and column, common mistakes are fixed for you and large numbers are never rounded.

Or paste into the box below. It is checked as you type.

Your JSON is read on this device. Nothing is uploaded.

Errors you can find

"Unexpected token" isn’t an error message anyone can act on in a 3,000-line file. When the JSON is invalid, this tool shows the line and column and the line itself with a marker under the problem. The usual culprits are a comma after the last item, a missing comma between items, a single quote where a double quote belongs and a comment copied from a config file.

Numbers that stay exact

IDs from databases, social platforms and payment systems are often 64-bit integers, larger than JavaScript can represent. Parse them the ordinary way and the last few digits change, silently, which turns one record's ID into another's. Services that know this publish IDs as strings as well. This formatter protects those numbers before parsing and restores them afterwards, so formatting never changes a value.

Formatting and minifying

Two-space indentation is the common default for readability, four spaces or tabs if your project prefers them. Minify removes every unnecessary space and line break for sending or storing, typically cutting the size by a quarter or more. Neither changes the data. To turn a list of records into a spreadsheet, use JSON to CSV.

Common questions

Why does it warn about large numbers?

JavaScript stores every number as a 64-bit float, which holds integers exactly only up to 9,007,199,254,740,991. Most JSON tools and most browsers, silently round anything larger: 12345678901234567890 becomes 12345678901234567000. This formatter keeps those numbers digit for digit and warns you, because the program that reads the file next probably won’t.

What does fixing common mistakes change?

It accepts the things people write by hand that strict JSON forbids: trailing commas, comments, single-quoted strings and unquoted keys. The error is still reported with its location, so you can fix the source and the output is always strict, valid JSON.

Is the data sent to a server?

No. Everything is parsed in your browser. That matters more than it sounds: JSON pasted into formatters is often an API response containing tokens, keys or customer records.

Why sort keys?

Two JSON files with the same data can list keys in any order, which makes comparing them line by line useless. Sorting keys alphabetically at every level puts both in the same order, so a diff shows only real differences.

How large a file can it handle?

Tens of megabytes comfortably. The limit is your browser’s memory and the output box, not the parser, is what slows down first with very large files; download the result instead of scrolling it.

Guides

The other tools

All of them work the same way: the file is read in your browser and never uploaded.