Home › Blog › How to format and validate JSON
Developer Tools guide

How to format and validate JSON

Minified or hand-written JSON is hard to read. This tool re-indents it, optionally sorts the keys, and tells you exactly where invalid JSON breaks.

Open the JSON Formatter tool

Step by step

  1. Paste your code. Type or paste it into the left box, or paste a snippet from your editor.
  2. Choose options. Pick the indent size or other settings. The result updates as you type.
  3. Copy or download. Copy the result or save it as a file.

Tips for better results

  • Switch to Minify to remove all whitespace before sending JSON in a request.
  • Sorting keys makes two JSON files easier to compare.
  • The error message shows the line and column of the first problem.

Limits to know

  • Formats: JSON (RFC 8259)
  • Size: Limited by browser memory
  • Notes: Runs fully in your browser. Very large inputs (several MB) can slow the page.

At a glance

ToolJSON Formatter
CategoryDeveloper Tools
Works withJSON (RFC 8259)
Size limitLimited by browser memory
Where it runsIn your browser tab; your input is not uploaded
CostFree, no sign-up

Frequently asked questions

Does it change my data?

No. Values are kept as they are; only spacing (and key order, if you choose to sort) changes.

Why does it say Invalid JSON?

Common causes are trailing commas, single quotes, unquoted keys or comments. Standard JSON does not allow them.

Is the JSON uploaded?

No. It is parsed in your browser.

If something does not work

  • The result is empty. Check that you typed or pasted text into the input box and that the options are not hiding everything.
  • The page feels slow. Very large text slows any browser tool. Work on smaller parts.
  • Characters look wrong. Make sure the text is saved as UTF-8 in the program you copied it from.
  • Copy does not work. Some browsers block automatic copying; select the result and copy it yourself.

Still stuck? Use Report a Problem and tell us the tool, your browser and what happened, or read the Help Center.

Related tools and guides

More tools like this are in Developer Tools, or browse all tools.