purr.tools

JSON Formatter

Paste JSON to format (prettify) or minify it. Invalid JSON shows a clear error message.

Share this calculation

Copy this link to share your current inputs with anyone.

How to use the JSON formatter

Paste your JSON into the input box and click Format to prettify it with 2-space indentation, or Minify to compact it into a single line. If your JSON has a syntax error, the exact error message is shown so you can fix it quickly.

JSON syntax reference

JSON supports six value types: string (double-quoted), number, boolean (true/false), null, array ([ ]), and object ({ }). Keys must be double-quoted strings. Trailing commas are not allowed. Use an online validator to catch issues like missing quotes, extra commas, or mismatched brackets.

FAQ

What is the difference between Format and Minify?

Format (prettify) adds indentation and line breaks to make JSON human-readable. Minify removes all whitespace to produce the smallest possible output — useful for APIs or storage where file size matters.

Does this tool send my JSON anywhere?

No. All formatting and validation runs entirely in your browser using JavaScript. Your data never leaves your device.

Embed this tool

Add this tool to your website by copying the snippet below.

<iframe
  src="https://www.purr.tools/en/embed/json-formatter"
  width="100%"
  height="500"
  style="border:0;border-radius:8px;"
  loading="lazy"
  title="JSON Formatter & Validator — Free Online Tool"
  allow="clipboard-write"
></iframe>