Skip to content
ToolBook

JSON Formatter & Validator

Format, validate and minify JSON instantly.

Loading the tool…

Paste JSON to pretty-print it, minify it, or check that it is valid. When something is wrong, the tool points to the line and column of the first problem and explains it in plain words. Everything runs in your browser, so API responses, config files and tokens you paste stay on your device.

How to use JSON Formatter & Validator

  1. Paste your JSON into the input box, or press Sample to see an example.
  2. Choose Format, Minify or Validate. For Format, pick an indent of 2 spaces, 4 spaces or a tab.
  3. Turn on Sort keys if you want object keys in alphabetical order.
  4. Read the result on the right, then use Copy or Download.
  5. If the status shows an error, press Go to error to jump to the position in your text.

Limits and tips

  • The tool checks strict JSON. Comments, single quotes and trailing commas are reported as errors, as the JSON standard requires.
  • Nesting deeper than 512 levels is rejected so the page stays responsive.
  • Input larger than 1 MB is not formatted as you type; press Format to run it.
  • Numbers keep the digits you typed. Very large numbers are not rounded by the formatter.

Private by design: how it works

This tool runs in your browser. The text you type or paste stays on this device and is never sent to a server. You can check it: open your browser network panel while you use the tool.

How we verify privacy ›

Frequently asked questions

Is my JSON sent to a server?

No. Formatting and validation run in your browser, and nothing you paste is uploaded. You can check this yourself: open your browser network panel while you use the tool and watch it stay quiet.

Why does my JSON show an error when it works in my code?

Many languages accept things strict JSON does not, such as comments, single-quoted strings or a trailing comma. The validator follows the JSON standard, so it flags these. Remove them, or convert the data to strict JSON.

What does Sort keys do?

It orders the keys of every object alphabetically. That makes two versions of the same data easier to compare. Arrays keep their order, because the order of array items can carry meaning.

Can it format a very large file?

Yes, within your browser limits. Above 1 MB the tool waits for you to press Format instead of running on every keystroke. Very large files depend on the memory your device has available.

Does it change my values when formatting?

No. Formatting only changes spacing and, if you ask for it, the order of keys. Strings, numbers, true, false and null are written out as they were.

Last updated 2026-10-04 · Reviewed by the ToolBook team