Irreva logo
Explore Irreva

Format JSON Online

Paste any JSON — raw, minified, or malformed — and format it into clean, readable output with proper indentation. Syntax errors are detected in real time. No upload, no account, runs entirely in your browser.

When Do You Need to Format JSON?

JSON is everywhere in modern development — API responses, configuration files, log outputs, database exports, webhook payloads. Most of the time, JSON is generated programmatically and arrives minified (all on one line, no spaces). That's fine for machines, but impossible for a human to read quickly.

Formatting adds indentation and newlines that expose the structure at a glance. When debugging an API response or reviewing a config file, formatted JSON cuts investigation time dramatically.

Common JSON Errors and How to Fix Them

Trailing comma

{"name": "John", "age": 30,}

Remove the trailing comma before the closing brace/bracket. JSON does not allow trailing commas (unlike JavaScript).

Single quotes instead of double quotes

{'name': 'John'}

Replace all single quotes with double quotes. JSON requires double quotes for both keys and string values.

Unquoted keys

{name: "John"}

Wrap all keys in double quotes: {"name": "John"}.

Missing comma between items

{"a": 1 "b": 2}

Add a comma after each value except the last: {"a": 1, "b": 2}.

Format vs Minify

Format (Beautify)

Adds indentation and newlines. Use for reading and debugging JSON.

{
  "name": "John",
  "age": 30,
  "active": true
}

Minify

Removes all whitespace. Use for production APIs and storage.

{"name":"John","age":30,"active":true}

Frequently Asked Questions

What does formatting JSON mean?â–¾

Formatting (also called beautifying or pretty-printing) JSON means adding proper indentation and line breaks so the structure is human-readable. Minified JSON has all whitespace removed to reduce size — it's machine-readable but hard for humans to scan. A formatter converts between these two forms.

Can the formatter fix invalid JSON?â–¾

The formatter detects and highlights syntax errors with a description of what went wrong and where. It cannot automatically fix errors — you need to correct them manually. Common JSON errors include missing quotes around keys, trailing commas, and using single quotes instead of double quotes.

Is my JSON data sent to a server?â–¾

No. All formatting happens in your browser using JavaScript's built-in JSON.parse() and JSON.stringify() functions. Your JSON never leaves your browser tab.

What indentation options are available?â–¾

You can format with 2-space indentation (standard for most codebases), 4-space indentation, or tab indentation. The default is 2 spaces.

Can I format JSON from an API response?â–¾

Yes. Copy the raw JSON from your API response (e.g. from browser DevTools, Postman, or curl output), paste it into the formatter, and click Format. The output is a readable, indented version you can inspect and debug.

Related Tools