The Otter family · try our other free tools: PDFOtter ↗ PixOtter ↗ Numbiqo UK money calculators ↗

JSON Formatter

Beautify, minify and validate JSON with clear error messages.

Read the full guide: How to Format and Validate JSON (Beautify & Minify Guide) →

Format, validate and minify JSON with this free online JSON formatter and validator. Paste messy or minified JSON and beautify it into clean, indented code, or compress it back down. Invalid JSON is flagged with a clear error message so you can fix it fast.

How to use the json formatter

  1. Paste your JSON into the box above.
  2. Click Beautify to indent and format it, or Minify to compress it.
  3. Fix any errors shown, then copy the result.

Why use ToolOtter's JSON Formatter?

  • Beautify & minify
  • Validates with clear errors
  • One-click copy
  • Private, runs in your browser

Worked example

An API returns {"name":"Numbiqo","tools":43,"free":true} on one line. Paste it and click Beautify to get each key on its own line with 2-space indents. Click Minify to squash it back to one line for sending.

If you paste {"name":"Numbiqo",}, the formatter reports an error instead, because JSON does not allow a trailing comma. The message tells you roughly where the problem is.

When people use it

  • Reading API responses while building or debugging an app
  • Checking a config file is valid before deploying
  • Making JSON readable for documentation or a support ticket
  • Minifying JSON to save space
  • Finding the missing bracket or quote in a long file

Good to know

The formatter follows strict JSON. Comments, single quotes and trailing commas are not valid JSON, even though some tools (and JavaScript itself) accept them. Error positions come from your browser and wording varies between Chrome, Safari and Firefox.

JSON Formatter, frequently asked questions

How do I format (beautify) JSON?

Paste your JSON and click Beautify. It is re-indented into clean, readable form; click Minify to compress it again.

How do I know if my JSON is valid?

If the JSON is invalid, the tool shows the exact error message so you can find and fix the problem.

Does it change my data?

No. Formatting only changes spacing and indentation, your values and structure stay identical.

Is my JSON uploaded anywhere?

Never. Validation and formatting happen locally in your browser.

Why does it say my JSON is invalid?

The most common causes are a trailing comma, single quotes instead of double quotes, or a missing comma between items.

Is it safe to paste API keys or customer data?

The formatter runs locally and sends nothing, but it is still good practice to remove secrets before pasting them anywhere.

What indentation does Beautify use?

Two spaces per level.