JSON Formatter
The fastest way to make JSON readable: paste it, get it pretty-printed, minified or validated — with a friendly error that points at the exact line and column when something's wrong. Everything runs in your browser, so API responses and config files never leave your device.
Everything runs in your browser — pasted data is never uploaded.
How it works
- Paste JSON into the input box — from an API response, a config file, or a course exercise.
- Choose Format (pretty-print with 2-space indentation), Minify, or Validate.
- Valid JSON is returned instantly with top-level key count and size.
- Invalid JSON produces a clear message with line and column, plus a hint about the usual culprits (missing commas, quotes or brackets).
The formula
What the formatter does
JSON.parse(input) → JSON.stringify(parsed, null, 2)
Parse-then-reserialize is the standard way to normalize JSON — it also catches duplicate keys and syntax errors.
Worked example
Worked example
- Input: {"course":"Physics","credits":3,"labs":[true,false]}
- Format → one key per line, nested arrays indented
- Minify → a single compact line, ideal for embedding
Both outputs round-trip to the exact same data — formatting never changes the meaning.
Common mistakes
- Trailing commas — valid in JavaScript objects, invalid in JSON. The validator flags them.
- Single quotes — JSON requires double quotes around keys and strings.
- Unquoted keys — {course: 1} is JavaScript, not JSON.
- Comments — JSON has no comment syntax; strip them before validating.
Frequently asked questions
Is my JSON sent to a server?
No. Formatting, minifying and validation all happen in your browser — paste as much as you like, including data you'd never want to upload.
What does 'invalid at line X, column Y' mean?
The validator points to where parsing stopped. Usually a missing comma between properties, an unclosed bracket, or a misplaced quote.
Can I use it for API responses?
Yes — paste a raw API response and Format makes it readable. That's the most common use.
Does it handle large files?
Yes — it processes in memory, so anything your browser can hold works (typically many megabytes).
Related tools
Students who used JSON Formatter also reach for these.
Base64 Encoder / Decoder
Encode or decode Base64 text instantly in your browser. Full UTF-8 (unicode) support, copy-ready output, zero data leaves your device.
Scientific Calculator
A fast scientific calculator in your browser: trigonometry, logarithms, powers, constants and brackets — with full keyboard support and an expression history.
GPA Calculator
Calculate your semester GPA by credit hours and letter grades. Supports 4.0 and 4.3 scales with instant, accurate results.