Pathine

JSON Formatter

Format, minify and read JSON that arrived as one long line.

Developer Free · no signup Runs on your device
JSON Formatter Nothing leaves this device
Your JSON
Formatted

Paste JSON above and it is checked as you type.

Your JSON is parsed in this tab and never sent anywhere.

Keyboard shortcuts
/ or K
Search every tool
Run this tool, from anywhere on the page
S
Download the result
?
Open and close this list

About the Pathine JSON Formatter

The JSON Formatter takes JSON that arrived as one unreadable line — an API response, a log entry, a config blob — and lays it out with consistent indentation so you can actually read it. The same tool minifies in the other direction.

It parses as you type, so the moment the document becomes valid you see the formatted version, and while it is broken you get the line and column of the problem rather than the word “invalid”.

Everything happens in this browser tab. That matters more here than on most tools: the JSON developers need to read is very often a production payload with real customer data or a token in it, and pasting that into someone else's server is a habit worth not having.


When you'd reach for it

An API response you have to read

Responses come back minified. Formatting one is usually the fastest way to see the shape of the data and find the field you were actually looking for.

A config file the parser rejects

A missing comma or one trailing comma too many will fail a deploy with an unhelpful message. Paste the file here and the exact line and column comes back, usually with the cause.

Making a payload smaller

Minifying strips every byte of whitespace, which matters for request bodies, embedded config, and anything that has to fit inside a size limit.

Comparing two documents

Formatting both with the same indent first makes a diff meaningful — otherwise you get one enormous changed line and no information.


How to format JSON

  1. Paste your JSON

    Drop it into the left pane. It is parsed as you type — there is no button to press to start.

  2. Read the result, or the error

    Valid documents appear formatted on the right. Broken ones get the line, the column, the surrounding text, and a likely cause where there is one.

  3. Choose your indent

    Two spaces, four spaces or tabs. Switch to Minify to strip whitespace instead.

  4. Copy or download

    Copy puts the result on your clipboard; download saves it as a .json file. Your indent and style choice are remembered.


Common questions

Is my JSON sent to a server?

No. The parsing and formatting happen in this browser tab using the browser's own JSON parser. Nothing is transmitted, which is why the tool keeps working with the network off.

Why does it say my JSON is invalid when it looks fine?

The three usual culprits are a trailing comma before a closing bracket, single quotes instead of double quotes, and unquoted property names. All three are legal in JavaScript and illegal in JSON, which is why they are easy to miss. The error message names them where it can tell.

Does formatting change my data?

No. Only whitespace changes. One thing worth knowing: keys keep their original order, but very large integers beyond JavaScript's safe range can lose precision on the way through any JSON parser, including this one.

Can it handle a large file?

Comfortably into the megabytes. Because the work is on your own device there is no upload limit, though a very large document will feel slower on an older phone.

What's the difference between formatting and validating?

Formatting has to parse the document, so it validates on the way past — if it formats, it is valid. The JSON Validator is the same engine pointed at explaining failures rather than producing output.

Does it support JSON with comments, or JSON5?

No. Comments and trailing commas are not part of the JSON specification, so a document containing them is reported as an error rather than quietly accepted.

Related tools

Next door.