JSON Formatter & Validator

Format, validate, and minify JSON. Pretty-print with syntax highlighting and tree view.

About this calculator

Paste JSON, press Format to pretty-print it, Minify to compress it or Validate to check it. The output panel has a Copy button.

Developers use it to read API responses, fix config files and clean data. The check runs in your browser, so private payloads stay private.

How to use it

  1. Paste your JSON.
  2. Press Format, Minify or Validate.
  3. Copy the result.

Rules of JSON

JSON has six value types: object {}, array [], string, number, true/false and null. Keys and strings need double quotes, there are no trailing commas, no comments and no single quotes. The formatter parses your text; if it parses, it re-prints it with indentation (or with all whitespace removed when minifying). If not, the error shows where the problem is.

Worked example

Input {"name":"Asha","age":30,"skills":["js","sql"]}

FormattedEach key on its own line, indented two spaces
Minified{"name":"Asha","age":30,"skills":["js","sql"]}

Runs entirely in your browser. Nothing you paste is uploaded.

Tips and common mistakes

  • Most JSON errors are trailing commas, single quotes or unquoted keys.
  • Minify JSON for production payloads and format it for reading.
  • Large numbers beyond 2⁵³ lose precision in JavaScript.
  • JSON has no comments; use a separate field if you need notes.
  • Validate API responses before parsing in code.

Frequently asked questions

What is JSON?

A text format for structured data, based on JavaScript object syntax.

Why does my JSON fail to parse?

Usually a trailing comma, single quotes or missing quote marks.

What does minify do?

Removes all unneeded whitespace.

Can JSON have comments?

No.

What is the difference between JSON and a JavaScript object?

JSON is stricter: double quotes only, no functions or undefined.

Is my data sent to a server?

No.

Related tools