JSON Formatter & Validator

Make JSON readable in one click, find exactly where it breaks, and repair common mistakes automatically.

How to format JSON

  1. Paste JSON, open a file or click Sample.
  2. Choose indentation, sorting, repair or a JSONPath filter — see Formatted, Tree and Table views.
  3. Copy the result or download it as a .json file.

About JSON Formatter

Format, beautify, minify and validate JSON.

Everything works in your browser, so it is instant and private, and your settings are remembered on this device.

Good for

  • Reading and debugging API responses
  • Cleaning up config and package files
  • Fixing JSON copied from logs, JavaScript or Python

Tip: Turn on “Sort keys” before comparing two JSON files — the differences become much easier to see.

Frequently asked questions

How do I format JSON?

Paste your JSON, drop a .json file or click Sample — it is formatted instantly with 2 spaces. Choose 4 spaces, tabs or Minify, then copy or download the result.

Can it fix invalid JSON?

Yes. With “Fix broken JSON automatically” on, trailing commas, comments, single quotes, unquoted keys, Python values like True and None, missing commas and unclosed brackets are repaired and listed so you can check them.

How do I find the error in my JSON?

Invalid JSON shows the exact line and column, a snippet with a pointer to the problem and a plain-English hint. The line is marked in the editor — click the line button to jump to it.

What is the tree view?

A collapsible view of the structure. Search keys and values, expand or collapse everything, and click a key to copy its path (like $.orders[0].total).

Can I filter JSON with JSONPath?

Yes — type a path such as $.orders[*].total or $..email to show only the matching values.

Is my data uploaded?

No. Everything is processed by JavaScript in your browser — nothing you paste or open is sent to a server, so it is safe for API responses, tokens, configs and customer data. It also works offline once the page has loaded.

Related tools

← Back to all tools