Corvo

Code & data

JSON Formatter & Validator

Format, validate and minify JSON online. Get the exact line and column of any syntax error. Free, no signup, and your data never leaves your browser.

Runs entirely in your browser. Nothing is uploaded.

Input Paste, type, or drop a .json file
Output
Formatted JSON appears here.
Waiting for input Ln 1, Col 1

What this tool does

JSON is easy for machines to read and, once it arrives on one line with no whitespace, genuinely hard for people to read. This page fixes that in both directions: it takes unreadable JSON and gives it consistent indentation so you can follow the structure, and it takes readable JSON and strips it back down for shipping.

It also validates. Paste something broken and you get the exact line and column of the first syntax error, plus the offending line with a marker under the character that caused it — which is usually all you need, because JSON errors are almost always a stray comma or a missing brace rather than anything subtle.

Everything happens inside your browser tab. The page has no backend for this: the parsing is done by the JavaScript engine already sitting in your browser, so your data never crosses the network. That matters when the thing you are debugging is an API response with a customer's details in it.

How to use it

  1. Paste your JSON into the input pane, or drop a .json file onto it.
  2. Pick an indent width — two spaces is the common default, four if your team prefers it.
  3. Press Format, or Ctrl+Enter (+Enter on a Mac).
  4. Read the status bar. Green means valid; red gives you the line and column to fix.
  5. Copy the result, or download it as a file.

Turn on Sort keys to reorder every object alphabetically. This is the trick for diffing two API responses that contain the same data in a different order — sort both, then compare, and only the real differences show up.

The five errors that cause most failures

1. A trailing comma

JavaScript allows a comma after the final item in an array or object. JSON does not. This is by far the most common cause of a parse failure.

2. Single quotes

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

3. Unquoted property names

name: "Ada" is a valid JavaScript object literal but invalid JSON. The key needs quotes too.

4. Comments

Strict JSON has no comment syntax. Files that use them — tsconfig.json and VS Code settings, for example — are really JSONC, a different format.

5. NaN, Infinity and undefined

None of these are JSON values. Numbers must be finite, and the only literals allowed are true, false and null.

Minify or format?

Format while you are reading or debugging. Minify when the JSON is about to be transmitted or stored: removing whitespace typically cuts 10–20% off the size, and more on deeply nested documents. If the response is served with gzip or brotli compression the saving is much smaller, since compression handles repeated whitespace well anyway — so for API payloads this is a modest optimisation rather than a dramatic one.

Questions

Is this JSON formatter free?

Yes, completely, with no account and no usage limit. The page is supported by advertising, not by a subscription.

Is my data safe to paste here?

Yes. Formatting and validation happen in JavaScript inside your own browser tab. Nothing you paste is sent to a server, so there is nothing for us to store or log. You can prove it: open your browser devtools, switch to the Network tab, and format something — you will see no requests.

Can I use it for work or client projects?

Yes. There are no restrictions on commercial use. That said, if your employer forbids pasting production data into any third-party site, follow that policy — a local editor is the right answer in that case.

Why does my JSON fail to validate when it looks fine?

The four most common causes are a trailing comma after the last item, single quotes instead of double quotes, unquoted property names, and a comment. All four are legal in JavaScript but not in JSON. The error panel gives you the line and column so you can go straight to it.

What is the largest file it can handle?

Files up to a few megabytes are comfortable. Beyond roughly 10 MB the browser tab will start to feel slow, because the whole document has to be held in memory twice. For anything larger, a command-line tool such as jq is a better fit.

Does it support JSON5, JSONC or NDJSON?

Not yet — this tool validates strict JSON as defined by RFC 8259, which is what APIs and config parsers expect. Comment-tolerant and line-delimited variants are on the list.

Related tools