🛠️ ToolGhar 162 free tools • No sign-up

JSON Formatter

Paste messy or minified JSON and turn it into clean, indented, readable JSON in one click. It also validates your JSON and tells you exactly what is wrong if it is invalid.

How to use it

Paste your JSON into the box and click Format JSON. The formatted result appears below with 2-space indentation. Click Minify to compress it back to a single line. If the JSON is invalid, you will see a clear error message instead of a result.

Everything runs in your browser — your JSON is never uploaded anywhere.

JSON quick reference

JSON valueExample
Object{"name": "Sara"}
Array[1, 2, 3]
String"hello" (double quotes only)
Number42, 3.14, -7
Boolean / nulltrue, false, null
Nested object{"user": {"age": 30}}

Common mistakes: single quotes instead of double quotes, a trailing comma after the last item, and missing quotes around keys.

Frequently asked questions

What does the JSON Formatter do?

It takes compact or messy JSON and reprints it with 2-space indentation and one value per line, so you can read and debug it easily. It uses the same formatting as the JSON tool on ToolGhar.

What happens if my JSON is invalid?

You get a clear error message describing the problem, for example an unexpected token or a missing comma. Fix the spot the message points to and format again.

What does Minify do?

Minify removes all unnecessary spaces and line breaks and compresses the JSON to a single line. It is useful when you need to paste JSON into a URL, a config file or an API request.

Is my JSON data private?

Yes. Formatting and validation run entirely in your browser. Nothing you paste is sent to a server or stored anywhere.

More free tools