JSON Formatter

Developer Tools

Format, validate & minify JSON

FreePrivateInstant
Add a file · .txt .md .csv .json … · up to 2.00 MB
Full guide, 3 min readWhy your JSON will not parse, and how to find the bad commaRead the story behind this tool →
Embed this tool on your websiteFree
  1. Choose how tall the frame should be.
  2. Press Copy code.
  3. Paste it into your page, blog, WordPress or Notion HTML block.
Height

The tool runs inside your visitor's browser, nothing is uploaded, and a small "Powered by ToolCloak" line stays under it. The second line (script) is optional: it makes the frame fit the tool's height.

Similar tools you may like

History

All history →

JSON Formatter — at a glance

Turn messy one-line JSON into neat, indented, easy-to-read JSON — and check it for errors.

Messy JSON
{"name":"Raj","age":25,
"city":"Delhi"}
Format
Pretty JSON
{
"name": "Raj",
"age": 25,
"city": "Delhi"
}

How to use it — step by step

You can also minify JSON to make it as small as possible.

1

Paste JSON

Paste your JSON (from an API, file or code) into the input box.

2

Choose mode

Pick Format to beautify or Minify to compress. Set indent to 2 or 4 spaces.

3

Press the button

If there is a mistake, you will see an error telling you where.

4

Copy output

Copy the clean JSON with one click.

Pro tips

Small things that make the result better.

✦All keys and strings need "double quotes" — single quotes are invalid in JSON.
✦No trailing comma after the last item.
✦Use Minify before sending JSON in production to save bandwidth.

Quick facts

2 / 4space indent options
Validatesshows syntax errors
Minifysmallest possible size
PrivateJSON stays in your browser

Frequently Asked Questions

Why does my JSON show a syntax error?+

Common causes: a trailing comma, single quotes instead of double quotes, a missing comma between items, or an unclosed bracket.

Format vs Minify — what is the difference?+

Format adds spaces and line breaks so humans can read it. Minify removes them to make the file smaller.

Can JSON have comments?+

No. Standard JSON does not allow comments.

Is my data safe?+

Yes. Everything runs inside your own browser. Your text, files and images are never uploaded to any server.

More Free Tools