JSON Formatter & Validator

Paste JSON to indent it, minify it, or find out why it won't parse. It runs in your browser.

Your data stays in your browser

This tool runs on JavaScript inside your browser. Nothing you add here is uploaded to our server, so it works for confidential data too. How we handle data

  • No upload
  • Processed on your device
  • No account

How do I make messy JSON readable?

Paste it and press Beautify. API responses and log lines usually arrive as one enormous line, which is fine for computers and painful for people. Beautify adds indentation and line breaks and colors keys, strings, numbers and booleans differently, so you can spot the field you're after in seconds.

How do I find the error in invalid JSON?

Hit Beautify. If the JSON won't parse, you'll see the browser's error message instead, which normally includes the position where things went wrong. The usual suspects are:

  • A trailing comma after the last item in an object or array
  • Single quotes instead of double quotes around keys or strings
  • Keys without quotes, which is fine in JavaScript but not in JSON
  • A missing comma between two items
  • Comments. JSON doesn't allow them.

The messages can be cryptic: a trailing comma, for instance, shows up as "expected double-quoted property name". Our guide to JSON error messages lists the exact wording for each mistake and what it really means.

Which JSON rules does the validator follow?

The ones in the JSON standard, RFC 8259 (the same grammar as ECMA-404). The check uses your browser's built-in JSON.parse, the parser every web app relies on, so if it passes here it will parse in Chrome, Firefox, Safari and Node.js. That means strings and keys in double quotes, no trailing commas, no comments, and no NaN, Infinity or undefined. You can get the same yes-or-no answer in your browser's developer console by running JSON.parse(text); this page adds indentation, colors and copy.

Two things to know about how browsers read JSON. If an object has the same key twice, the last value wins and the first is dropped without a warning. And whole numbers bigger than 9,007,199,254,740,991 (253 - 1) lose precision, so a 19-digit ID like 12345678901234567890 comes back as 12345678901234567000. If your data has IDs that long, keep them as strings.

Why format JSON in the browser instead of on a server?

Speed and privacy. There's no upload and no waiting for a reply: the text goes straight from the box into your tab's memory, gets parsed and is printed back. A few megabytes take well under a second on a normal laptop. Very large files (tens of megabytes) can freeze the tab for a moment, because your own device does the work, so a command-line tool like jq is the better choice there.

Is it safe to paste API keys or customer data?

Yes, as far as we're concerned. The formatter runs entirely in your browser, so your JSON is never sent to our server. Still, it's a good habit to rotate any secret you've pasted somewhere unexpected. Working with encoded payloads? Decode them with the Base64 Decoder or the URL Decoder first. Need test IDs? Generate them with the UUID Generator. Our JSON formatting guide goes deeper.

Starting from a spreadsheet? Turn the rows into JSON first with the CSV to JSON Converter.

Questions people ask

How do I beautify JSON online?

Paste it into the box and click Beautify. You'll get indented, color-coded JSON you can copy.

How do I validate JSON?

Click Beautify. Valid JSON gets formatted. Invalid JSON shows an error message describing what went wrong and roughly where.

What's the difference between beautify and minify?

Beautify adds spacing to make JSON easy to read. Minify strips all spacing to make the file as small as possible. The data is identical either way.

Why is my JSON invalid?

Most often it's a trailing comma, single quotes, unquoted keys, or a comment. JSON is stricter than JavaScript.

Can it handle large JSON files?

Yes, several megabytes work fine. Very large files can make the page sluggish for a few seconds, since your own device does the work.

Is JSON Beautifier the same tool?

Yes. Our old JSON Beautifier page now points here, because it did the same job.

Related tools