Skip to content
Test versionSearch

Developer tools

JSON formatter and validator

Validate JSON, format it with 2 or 4 spaces or tabs, or remove spacing. Copy or download the result.

How it worksFAQRelated tools

Content reviewed:

Also available for Germany, in German 

Paste JSON, select Format or Minify, then run the tool. Use Select if clipboard access is unavailable.

Runs in your browser. The input is not uploaded or stored. Formatting preserves number spellings and duplicate keys; it changes only whitespace outside strings. A malformed document is refused without a replacement result. Optional own UTF-8 file up to 32 KiB and 20000 UTF-16 units; raw file and form line endings are recorded separately. CSV protects formula-like lines with an apostrophe; printable HTML refuses unsupported control characters. Optional live calculation is off by default. The original JSON download contains the result. The additional JSON export contains the input, selected options and exact result.

How it works

JSON.parse checks syntax. The formatter then changes only whitespace outside quoted strings, preserving numeric spelling, duplicate keys and string escapes. Shared own file and JSON/numbered-line CSV/printable HTML exports record the unchanged calculation result and actual selected options. Runs in your browser. The input is not uploaded or stored. Formatting preserves number spellings and duplicate keys; it changes only whitespace outside strings. A malformed document is refused without a replacement result. Optional own UTF-8 file up to 32 KiB and 20000 UTF-16 units; raw file and form line endings are recorded separately. CSV protects formula-like lines with an apostrophe; printable HTML refuses unsupported control characters. Optional live calculation is off by default. The original JSON download contains the result. The additional JSON export contains the input, selected options and exact result.

Worked example

Example: {"name":"Ada","items":[1,true,null]}

Worked example

With these example values the calculator gives the result below. You can change any value in the form above.

Inputs

JSON input
{"own":"sample 🚀","count":2}
Operation
Format
Indentation
2 spaces

Result

Result
Unicode code points: 37

Frequently asked questions

How do I format JSON with indentation?

Paste JSON, select Format and choose 2 or 4 spaces or tabs. Select Minify to remove spacing instead.

How does the formatter check my JSON?

JSON.parse checks syntax. A malformed document is refused without a replacement result.

Does formatting change my numbers or keys?

No. It changes only whitespace outside strings, preserving number spellings, duplicate keys and string escapes.

Is my JSON uploaded?

No. It runs in your browser, and the input is not uploaded or stored.

What size of JSON can I format?

Up to 20,000 UTF-16 code units, or an optional UTF-8 file up to 32 KiB.

What can I download?

Exact result JSON, a numbered line CSV and a printable result HTML.