JSON Formatter

Format, beautify, and minify JSON online. Free, fast, and private, everything runs in your browser.

Independently verified for accuracy

Calculator by Toolsloft ↗

This tool pretty-prints, reindents, or minifies any JSON text entirely in your browser. Use it to make a compact API response readable, to standardize indentation before committing a config file, or to strip whitespace down to the smallest valid payload.

How this is calculated

It parses the input with the browser's native JSON.parse and re-serializes it with JSON.stringify using your chosen indent (2 spaces, 4 spaces, a tab, or no whitespace for minify); anything JSON.parse rejects is reported as invalid.

How to use

  1. Paste your JSON into the input box.
  2. Choose an indent size, 2 spaces, 4 spaces, tab, or minify.
  3. Copy the formatted result.

Examples

  • Minified object: {"name":"Ada","langs":["Go","TS"]}
  • Nested array: {"items":[{"id":1},{"id":2}]}

FAQ

Is my JSON sent to a server?
No. All formatting happens locally in your browser, your data never leaves your device.
What does minify do?
Minify removes all whitespace and newlines, producing the smallest valid JSON on a single line.
Why does it say invalid JSON?
Your input is not valid JSON. Common causes are unquoted keys, trailing commas, or single quotes instead of double quotes.

Embed this calculator

Add this free calculator to your own site. Copy the code and paste it where you want it to appear.