Toolivaro

Free JSON Formatter & Validator

Format and validate JSON with readable indentation, precise error messages, and byte-size stats — fully local.

Processed locally in your browser

Processed locally in your browser — pasted JSON is never uploaded, logged, or stored.

How is the result calculated?

Formatting a compressed API response

An API returns {"status":"ok","items":[{"id":1,"name":"A"},{"id":2,"name":"B"}]}. The formatter produces one property per line with two-space indentation, making the nesting visible at a glance. The stats panel shows the input is 68 bytes while the formatted version is 101 bytes — the whitespace cost of readability.

Example input and output
Input Value
json {"status":"ok","items":[{"id":1,"name":"A"},{"id":2,"name":"B"}]}
Result Valid JSON · formatted with 2-space indent · input 68 B → formatted 101 B

What is the formula and its assumptions?

Formatting method

format(json) = JSON.stringify(parse(json), null, 2)

Formula terms
Symbol Meaning
parse standard JSON parser (RFC 8259 semantics)
null, 2 no replacer; two-space indentation

Formatting never changes the data — parse and re-stringify is a lossless round trip for valid JSON.

Validation

valid ⇔ parse(json) succeeds

Formula terms
Symbol Meaning
valid grammatically correct JSON per RFC 8259

Syntax-valid JSON can still be semantically wrong for your application — validation checks grammar, not meaning.

What are the most common mistakes?

  • Pasting JSON with trailing commas or comments and expecting it to parse — standard JSON rejects both.
  • Treating syntax validity as semantic correctness: a valid document can still fail your application’s schema.
  • Formatting sensitive data with an online tool that uploads it — this tool never sends anything anywhere.

What are the assumptions and limitations?

  • Validation is grammatical (RFC 8259), not semantic — it cannot judge whether the data matches your schema.
  • Very large documents (hundreds of MB) may slow the browser; the tool is designed for typical configs and API payloads.
  • Output uses two-space indentation only; other indentation styles are not configurable in version 1.

Where do the numbers come from?

Last reviewed August 4, 2026 · Version 1.0.0 · Toolivaro does not guarantee external content.

Frequently asked questions

Is formatting safe for JSON with duplicate keys?

The parser keeps the last value for a duplicate key (standard JSON behavior), and the formatter preserves exactly what the parser accepted. If duplicate keys matter to you, validate with your own schema — JSON itself does not forbid them.

Why does my JSON fail validation?

Common causes: trailing commas, single-quoted strings, unquoted keys, comments, and trailing garbage after the document. The error message includes the parser position when available so you can jump to the problem.

Does this tool support JSON5 or YAML?

No — this tool accepts standard JSON only. Comments and trailing commas are JSON5 features and are intentionally rejected; use a dedicated converter for those formats.

Found a mistake or have a correction? Report it — we review every correction.