All Tools View Categories About Contact Privacy

JSON Formatter & Validator

Pretty-print, minify, validate and repair JSON — with precise error locations.

Runs entirely in your browser. Nothing is uploaded.

About JSON Formatter & Validator

Debugging a JSON payload, tidying an API response or chasing a syntax error? JSON Formatter & Validator pretty-prints, minifies, validates and repairs JSON in one click — with friendly error messages that point you to the exact spot.

Features

  • Pretty print with configurable indentation (2, 4 or tabs).
  • Minify to the smallest valid representation.
  • Validate with precise line & column error reporting.
  • Auto-repair common mistakes: missing quotes, commas, trailing commas.
  • Key sorting option for consistent output.
  • Stats: key count, depth, size before/after.

How to Use

  1. Paste your JSON or load the sample.
  2. Check — the tool validates instantly and shows any error with position.
  3. Format, minify or repair with one button.
  4. Copy or download the result.

Examples

Example 1 — API debugging. A developer pastes a mangled API response, hits Repair, and gets clean readable JSON.

Example 2 — Code cleanup. A developer minifies a config file before embedding it in a build script.

Example 3 — Learning JSON. A student pastes examples with trailing commas to understand why they fail.

Example 4 — Config editing. An analyst reformats a large settings file with 2-space indentation to match team style.

Benefits

  • All-in-one: format, validate and repair in one place.
  • Precise errors: line and column pointing to the problem.
  • Instant feedback: validation on every keystroke.
  • Safe: your data never leaves the browser.
  • Free: no sign-up, no limits.

Frequently Asked Questions

How does this JSON formatter work?
It parses your JSON and re-emits it with proper indentation, so formatting mistakes (odd spacing, broken line breaks, trailing commas) are corrected automatically while the data stays identical.
Can it repair broken JSON?
Yes. The repair mode fixes the most common syntax errors: missing quotes around keys, single quotes instead of double, trailing commas, missing commas between values, and unquoted string values.
Does formatting change my data?
No. Formatting only changes whitespace and line breaks. Minifying only removes them. The data content is preserved exactly.
What is the difference between Pretty Print and Minify?
Pretty Print adds indentation and line breaks for readability. Minify compresses everything onto as few bytes as possible — ideal for storage or transmission.
Why do I get 'Unexpected token' errors?
That error usually means a missing comma, a stray quote, or an invalid character. Use the repair button first — it fixes the most common mistakes automatically — then review the line and column shown in the error.
Is my JSON uploaded anywhere?
No. Everything runs locally in your browser. Your JSON never leaves your machine.