DoItAl

Data utility

JSON Formatter, Validator & Viewer

Validate, format, and minify JSON locally while preserving number literals. Download the full result or inspect a bounded parsed tree preview.

Browser-local • No upload

Loading tool controls…

Local tool controls

What this tool does

Checks JSON syntax, indents or removes insignificant whitespace, exports the result, and optionally displays a small parsed tree.

How to use it

  1. Paste JSON, including an object, array, or standalone JSON value.
  2. Choose two or four spaces and Format, Minify, or Validate.
  3. Download the result; open the tree for small inputs if helpful.

Worked example

{"items":[1,2],"active":true} can be indented without changing its literals. An input containing {"items":[1,]} fails validation because trailing commas are not JSON.

Processing and explanation

JSON.parse checks syntax, but the formatter writes original lexical tokens rather than serializing JavaScript numbers. This preserves large integer literals, exponent notation, escape sequences, duplicate keys, and key order in text exports.

Limits and common mistakes

1 MB UTF-8 input and at most 100 nested levels for formatted output. Comments, single-quoted strings, trailing commas, NaN, and Infinity are invalid JSON. Syntax validity does not prove your API schema is correct. The optional parsed tree can round large numbers and keeps only the last duplicate key; the exported text does not.

Privacy and your input

Text is read in this tab. This tool does not upload your text or include it in analytics; clearing the field removes the working input.

Frequently asked questions

Does formatting validate an API request?
It validates JSON grammar only. Required fields, allowed values, and server rules need a separate schema check.
Can I use this on JavaScript objects?
Only if they follow JSON syntax: quote property names, use double-quoted strings, and remove comments.

Material content update: