Skip to content

JSON Formatter & Validator

Format, validate and minify JSON with the exact line and column of any error, optional key sorting and 2-space, 4-space or tab indentation.

In-browser · no upload JSON → JSON

Runs entirely in your browser. Your files and text are not uploaded to our servers.

To format JSON, paste it and select Format. Valid JSON is pretty-printed with your chosen indentation; invalid JSON shows exactly where the problem is — for example “line 3, column 12: unexpected }” — with hints for common mistakes like trailing commas or single quotes.

How to use the JSON Formatter & Validator

  1. 1

    Paste or open JSON

    From an API response, config file or log.

  2. 2

    Format, minify or validate

    Choose indentation and optional A–Z key sorting.

  3. 3

    Copy or download

    Save as formatted.json.

Features

  • Precise error location

    Line and column, not just “invalid”.

  • Sort keys

    Stable output for diffs and reviews.

  • Minify

    Shows the size saving.

  • Private

    JSON never leaves your browser — safe for tokens and configs.

Examples

{"a":1,"b":[1,2,],} → Invalid JSON at line 1, column 17: unexpected “]” (trailing commas are not allowed).

Privacy and file handling

Where it runs
Runs in your browser

Runs entirely in your browser. Your files and text are not uploaded to our servers.

Limitations

  • JSON with comments (JSONC) or trailing commas is reported as invalid, because standard JSON doesn’t allow them.
  • Numbers beyond JavaScript’s safe integer range may lose precision when formatted.

Frequently asked questions

What are the most common JSON errors?

Trailing commas, single quotes instead of double quotes, missing quotes around keys, and comments. The error message points to the exact position.

Is it safe to paste API keys or tokens?

Everything runs in your browser and nothing is sent anywhere. Still, avoid pasting secrets on shared computers.

Was this tool helpful?

Thanks for the feedback.

Last reviewed