Ready, runs in your browser
0 chars · 0 words
bytes leaving your device
0
steps to readable JSON
3
on length or runs
No cap

JSON prettifier

What the JSON prettifier does in your workflow

This JSON prettifier sits between the thing that produced the JSON and the thing you are about to do with it. A response comes back minified, a config file arrives with no formatting, a payload gets copied out of a log line. You paste it, it comes back indented two spaces per level with one value per line, and you carry on.

It is local. The parse and the reindent both happen in the browser tab, so pasting a response that contains a bearer token or a customer record does not put that data on anyone's server. There is no signup and no run limit to plan around.

The three steps

How to use the JSON prettifier in three steps

The whole loop takes a few seconds and does not interrupt whatever you were doing.

Step 1
Paste the JSON in, minified or half-indented, it does not matter which.
Step 2
Press Format. The tool parses it and reindents at two spaces, on your device.
Step 3
Copy the output straight into your editor, your ticket or your diff.

Debugging

Using a JSON formatter in a debugging loop

The common case is not admiring the formatting, it is answering one question fast: what did the API actually send back? A minified response hides that. Indented, you can see in a second whether the field you expected is present, whether it came back null, and whether the array has one element or four hundred.

Because there is no run limit, this works as a repeated step rather than a one-off. Call, paste, read, change something, call again. Nothing throttles you on the tenth pass.

Check shape first
Indentation tells you the nesting depth before you read a single value.
Then check presence
A missing key is obvious in a formatted object and invisible in a minified one.
Then check types
Quotes around a number are easy to spot once each value sits on its own line.

Code review

Why pretty-printed JSON gives a cleaner diff

Git and every code review tool built on it compare files line by line. A minified JSON file is one line, so changing one value anywhere in it marks the whole line as changed and tells a reviewer nothing about what moved.

Formatted, one key per line, the same change produces a diff showing exactly the line that differs. This is why JSON fixtures, configuration and committed API samples are almost always kept indented in a repository, even though the minified version is smaller. Run the file through here before you commit it and every future review of that file gets easier.

When it refuses

What to do when the JSON formatter says Invalid JSON

A rejection means the parser could not read the text as JSON. The app does not guess and does not repair, so the fix is to find the character JSON does not allow and remove it.

Work down this list in order. One of them is nearly always the culprit, particularly when the text came out of a JavaScript file or a config format that only looks like JSON.

Trailing comma
A comma after the final entry in an object or array. JavaScript permits it, JSON does not.
Single quotes
Keys and strings both need double quotes in JSON.
Unquoted keys
A bare key is a JavaScript object literal, not JSON.
Comments
Config files often carry them. JSON has no comment syntax at all.
NaN or undefined
Not JSON values. Serialise them as null or a string before they reach the payload.
Extra text around it
A log timestamp, a prompt, or a stray bracket copied along with the payload.

What you can and cannot change

Two spaces, fixed, and what that means for your workflow

The indent is two spaces per level with no option to change it. That matches the JavaScript and TypeScript default, and it matches what most JSON you receive already uses, so in practice the output usually drops straight into place.

If your project standardises on four spaces or tabs, paste the result into your editor and let the editor's formatter take the last step. Key order is preserved exactly as it arrived, so there is no alphabetical sort to undo either.

Straight answer

Does formatting JSON mean the data is correct?

No, and it is worth being clear about it. The only thing a successful format proves is that the syntax parses. A file can be perfectly indented and still carry the wrong value, a missing field, or a date stored as a string where a number belonged.

What formatting buys you is a surface a person can actually review, which makes those mistakes much easier to notice. The noticing is still yours to do. There is no schema check here and no validation beyond the parse.

Who it's for

Who reaches for a JSON prettifier, and when

Backend and frontend developers mid-debug, checking what an endpoint really returned. Reviewers tidying a fixture before it lands in a repository. QA and support staff reading a payload pasted into a bug report, trying to work out which field went wrong.

Also anyone outside engineering who has been handed an export and told the answer is in there somewhere. Formatted, a JSON file is browsable. Minified, it is a wall.

FAQ

Everything answered. JSON prettifier, in practice

How do I format JSON quickly?

Paste it in and press Format. The indented version appears straight away in the output panel.

Is the JSON prettifier free?

Yes, with no signup, no length cap and no run limit, because it runs on your own device.

Does my JSON get uploaded?

No. Parsing and reindenting both happen in your browser tab. Nothing is sent to a server.

Can I paste a response containing tokens or personal data?

Nothing leaves the browser, so it is not exposed to us. Treat your own clipboard and screen with the usual care.

What indent does it use?

Two spaces per nesting level, always. There is no option for four spaces or tabs.

Will it reorder my keys?

No. Key order is preserved exactly as it appeared in the input.

Does formatting change my data?

No. Only whitespace is added. Every value is identical afterwards.

Why is it telling me my JSON is invalid?

The text failed to parse. Check for a trailing comma, single quotes, unquoted keys or a comment before anything else.

Does it show the line number of the error?

No. It reports that the input is invalid without pointing at a line or column.

Will it repair broken JSON?

No. Invalid input is rejected rather than patched, so the fix has to happen before you paste.

Does it handle JSONC or JSON5?

No. Comments and trailing commas are not valid JSON, so strip them first.

Is there a maximum size?

No cap is set. How large a file works comes down to your device's memory, since the work is local.

Does it work on a phone?

Yes. The layout adapts to a narrow screen and formatting behaves the same.

How is this different from the JSON minifier?

The minifier does the reverse: it strips whitespace to shrink the payload. This one adds whitespace so you can read it.

Can I format just an array?

Yes. Any valid JSON value works, including a bare array, string, number or boolean.

Why does a formatted file diff better in git?

Git compares line by line. Minified JSON is one line, so any change marks the whole line. Formatted, the diff shows only the key that moved.

Should I commit JSON formatted or minified?

Formatted, in almost every case. The readability of future diffs is worth far more in a repository than the bytes saved.

Does it validate against a schema?

No. It confirms the syntax parses and nothing more. Values, types and required fields are not checked.

Can I open a file with it?

No, there is no file picker. Copy the contents of the file and paste them into the box.

Is there a tree view I can collapse?

No. The output is plain indented text, without folding or colour coding.

Is there an API or batch mode?

Not currently. It is a single-paste tool. For automation, JSON.stringify with an indent of 2 does the same job in a script.

Does formatted JSON stay valid?

Yes. Indentation is whitespace between structural characters, so any parser reads it identically.