◆ Online Dev Kit

JSON Formatter & Validator

Beautify, minify and validate JSON — instantly, in your browser.

About this tool

Paste any JSON and click Format to pretty-print it with 2-space indentation, or Minify to strip whitespace for the smallest size. If your JSON is invalid, the exact syntax error and position are shown so you can fix it fast. Everything runs locally in your browser — nothing is uploaded.

Common use cases

How it works

JSON (JavaScript Object Notation) is a lightweight data-interchange format using key-value pairs and arrays. The formatter parses the input into a syntax tree, then re-serializes it with consistent indentation (2 or 4 spaces), proper line breaks, and aligned colons. Validation checks for balanced braces, quoted keys, valid data types, and proper comma placement.

FAQ

Is my JSON uploaded anywhere?

No. This tool runs entirely in your browser using JavaScript. Your data never leaves your device.

Why does it say invalid JSON?

Common causes are trailing commas, single quotes instead of double quotes, or unquoted keys. The error message shows where parsing failed.

What indentation does it use?

Format uses 2 spaces. Minify removes all optional whitespace for the most compact output.

What is the difference between JSON and JSON5?

JSON5 is a superset that allows unquoted keys, single quotes, trailing commas, and comments. Standard JSON requires double quotes and no trailing commas.

Why does my JSON fail with "Unexpected token"?

This usually means unquoted keys, single quotes instead of double, trailing commas, or mismatched braces. The formatter will highlight the exact position of the error.