Penguin mascot
Developer Tools

JSON Formatter

Got a wall of minified JSON from an API? Paste it in, hit Format, and it comes out readable. Need it small again for shipping? Minify brings it back down.

Your formatted JSON will appear here.

If your JSON is invalid, the exact parser error shows up here instead โ€” no guessing.

How to use

  1. Paste your JSON into the input box โ€” a sample is already loaded so you can try it instantly.
  2. Click Format to pretty-print it with 2-space indentation, or Minify to compress it onto one line.
  3. Read the result in the output box. If your JSON has a syntax error, you'll see the parser's exact error message (like which character it choked on).
  4. Click Copy to copy the result to your clipboard, ready to paste into code, docs, or a request body.
  5. Everything stays local. Your JSON never leaves the page โ€” safe for tokens, configs, and API payloads.

Frequently asked questions

How do I format JSON with proper indentation online for free?

Paste your JSON into the input box above and click Format. The tool parses your JSON and re-prints it with clean 2-space indentation, so nested objects and arrays are easy to scan. Then use Copy to grab the result.

How can I minify JSON to make it smaller?

Click Minify and your JSON is compressed onto a single line with all unnecessary whitespace removed. That is exactly what you want before pasting payloads into URLs, config files, or minified API requests.

What does "Unexpected token" mean in a JSON error?

It means the parser hit a character where it didn't belong โ€” a stray comma, a missing quote, or a trailing comma are the usual suspects. This tool shows you the parser's exact message, including the position, so you can find and fix the offending character.

Is it safe to paste JSON with API keys into this tool?

Yes. Formatting happens entirely in your browser with JavaScript โ€” nothing is uploaded, stored, or logged anywhere. That said, as a general habit, redact secrets before sharing JSON with anyone or anything.

Why won't my JSON validate even though it looks right?

Common culprits: trailing commas after the last item, single quotes instead of double quotes, comments (JSON doesn't allow them), or unquoted keys. Paste it here and the error message will point you at the problem.

Related tools

Keep the momentum going.