JSON Formatter & Validator

Format, validate, and minify JSON in your browser. Pretty-print with 2/4-space or tab indent and catch syntax errors with line numbers — free, private, no uploads.

JSON status
Mode
Indent

Paste JSON above to format, minify, and validate it.

Runs entirely in your browser. Nothing you enter or upload is sent to a server.

What the results show

  • JSON status — a quick verdict: Valid when your text parses as correct JSON, or Invalid when it doesn't. It stays a dash () until you paste something.
  • Formatted JSON — your data re-indented and neatly aligned so nested objects and arrays are easy to read, using the indent width you pick (2 spaces, 4 spaces, or a tab).
  • Minified JSON — the same data with every optional space and line break removed, collapsed to a single compact line for the smallest possible payload.
  • Line & column — when the JSON is invalid, the tool points to where parsing failed so you can jump straight to the problem.

How it works

The tool parses your text with the browser's native JSON.parse — the exact same parser your code uses — so “Valid” here means valid everywhere. If parsing succeeds, it re-serializes the value with JSON.stringify: in Format mode it adds the indentation you chose, and in Minify mode it strips all whitespace.

Because it round-trips through a real parser, formatting also normalizes your data: keys keep their original order, but inconsistent spacing, redundant whitespace, and mixed indentation are all cleaned up. If parsing fails, the tool shows the parser's own error message along with the line and column where it gave up — a trailing comma, a missing quote, or a stray bracket is usually the culprit.

Frequently asked questions

Is my JSON uploaded or saved anywhere?

No. Formatting, minifying, and validation all run entirely in your browser using native JavaScript. Your JSON is never sent to a server, logged, or stored — closing or reloading the page discards it.

Why does it say Invalid or show a dash?

A dash appears when the box is empty — there is nothing to check yet. It says Invalid when your text isn't well-formed JSON; the message and the line/column tell you where the parser stopped so you can fix it.

What's the difference between Format and Minify?

Format (pretty-print) adds indentation and line breaks so JSON is easy for people to read. Minify removes all optional whitespace to make the smallest possible file — handy for API payloads, config values, and reducing bandwidth. Both produce identical data; only the spacing differs.

What counts as valid JSON?

Strict JSON requires double-quoted keys and string values, no trailing commas, and no comments. Values must be objects, arrays, strings, numbers, true, false, or null. JavaScript object literals, single quotes, and // comments are not valid JSON and will be flagged.

Can it fix or repair broken JSON automatically?

No — it validates and reports errors, but it won't guess your intent or auto-repair malformed input. Use the error message and line number to correct the source, then re-check. Keeping it strict means “Valid” genuinely means every JSON parser will accept it.

Is there a size limit?

There's no hard limit, and everything runs on your device. Very large documents depend on your browser's available memory, but typical API responses and config files format instantly.
Dasigba

Free, fast, privacy-first online tools. Everything runs in your browser.

© 2026 Dasigba