Skip to content
FreeToolsKit.app

JSON Formatter, Validator & Minifier

Check JSON for syntax errors, format it with readable indentation or minify it to a single line. Errors show the line and column, and formatting changes only the whitespace between values — large numbers, duplicate keys and escape sequences stay exactly as written. Everything runs in your browser.

  • Free to use
  • No account required
  • JSON stays in your browser

JSON Formatter, Validator & Minifier

Loading tool…

Was this tool helpful?

Good to know

Useful for
Reading API responses, checking configuration files, debugging structured data (JSON-LD) for SEO, shrinking JSON before sending it, and finding a missing comma or bracket.
Accepts
JSON text you paste or type, or a UTF-8 .json or .txt file up to 5 MB
Produces
Formatted or minified JSON to copy or download as formatted.json or minified.json

Privacy

Your JSON is checked and formatted in your browser — in a background worker for large documents. It isn't uploaded, sent to an AI service, saved in your browser or added to the page address. It is treated as data and never run as code.

Limitations

  • Only strict JSON (RFC 8259) is accepted: comments, trailing commas, single quotes, NaN and JSON5 are reported as errors, not repaired.
  • Input is checked up to 2,000,000 characters and 1,000 levels of nesting; output is limited to 10,000,000 characters.
  • It formats and checks syntax only. It doesn't validate against a JSON Schema, sort keys or convert values.
  • The structure summary counts object members, which can include duplicate keys; it isn't a count of unique keys.

Tips

  • Use Go to error to jump to the exact character the error refers to.
  • Minify JSON before embedding it in a URL or a request; format it when you need to read or edit it.
  • If a duplicate-key warning appears, decide which value you mean — many programs silently keep only the last one.

How to format, validate or minify JSON

  1. Paste or type JSON, open a .json or .txt file, or load the sample.
  2. Read the status: Valid JSON with a structure summary, or Invalid JSON with the line, column and a pointer to the problem.
  3. Choose an indentation (2 spaces, 4 spaces or tab) and select Format JSON, or select Minify JSON for compact output.
  4. Check any warnings, such as duplicate keys or numbers other programs may round.
  5. Copy the result, download it as a .json file, or use it as the new input.

Frequently asked questions

What does a JSON formatter do?

It adds line breaks and indentation so JSON is easy to read. This tool changes only the whitespace between values; keys, values, their order and escape sequences stay exactly as you wrote them. You can choose 2 spaces, 4 spaces or tabs.

How do I validate JSON syntax?

Paste or type your JSON. It is checked as you type against the strict JSON standard (RFC 8259); select Validate JSON to check it straight away. Valid JSON shows a summary of its structure; invalid JSON shows what's wrong with its line and column.

What is the difference between formatted and minified JSON?

Formatted JSON puts each value on its own indented line so people can read it. Minified JSON removes all the unnecessary spaces and line breaks, making it smaller for sending or storing. Both contain exactly the same data.

Does the formatter preserve large numbers and duplicate keys?

Yes. Numbers are copied exactly as written, so 9007199254740993, 123456789.123456789, 1e400 and -0 don't change. Duplicate keys are kept in place and shown as a warning, because many programs keep only the last value.

Why is my JSON invalid?

Common causes are a trailing comma, a missing comma or bracket, single quotes instead of double quotes, keys without quotes, comments, and values such as NaN or undefined. The error message points to the line and column where the problem was found; the actual mistake is sometimes just before it.

How large a JSON file can I format?

You can open .json or .txt files up to 5 MiB (about 5.2 MB), and up to 2,000,000 characters are analysed; longer pasted text is kept but not checked. Nesting deeper than 1,000 levels isn't supported. Very large documents can take a moment on slower devices.

Is my JSON uploaded or saved?

No. Everything happens in your browser. Your JSON isn't sent to a server or AI service, isn't saved in your browser storage and isn't added to the page address. Reloading the page removes it.