JSON Formatter

JSON Formatter & Validator

Paste JSON to pretty-print, minify, or validate it. Errors show the exact line and column. Everything runs locally in your browser.

Status: Waiting for input…

How to use it

  1. Paste or type JSON into the input.
  2. Pick Pretty (indent) or Minify, then choose indent size.
  3. Copy or download the result, or read the error message if the JSON is invalid.

Examples

Pretty-print API response

{"id":1,"name":"Ada"} → { "id": 1, "name": "Ada" }

Minify for a fetch body

{ "x": 1 } → {"x":1}

Spot a trailing comma

Pasting {"a":1,} shows the exact position of the invalid comma.

About this tool

A no-frills JSON formatter. Uses your browser's native JSON.parse, so behaviour matches what your JavaScript code will see. Handy for debugging API responses, cleaning config files, or checking that a webhook payload is valid before shipping it.

FAQ

Is my JSON sent to a server?
No. Parsing and formatting run entirely in your browser. Nothing is uploaded or logged.
What indent should I pick?
2 spaces is the most common in web code. Use 4 for Python-style output, or Tab if your team formats with tabs.
Why does it say 'Unexpected token'?
That means the JSON is invalid at the position shown. Common causes are trailing commas, single quotes instead of double, or unquoted keys.
Can it fix invalid JSON automatically?
It won't guess your intent, but the error message tells you the exact line and column, so fixing it usually takes seconds.
Is there a size limit?
The tool safely handles files up to about 5 MB. Larger inputs are refused so the page stays responsive.

Privacy

Everything runs locally in your browser. Your input is never uploaded, logged, or stored.