Input
Indent:
Mode:
Parsing…

What This JSON Formatter Does

JSON travels minified — one long line with no spaces, because bytes cost money on the wire. That is unreadable to a person, so the first job of a json beautifier is to put the line breaks and indentation back. Paste a response from an API, press Format, and you get an indented document you can actually follow, plus a tree you can collapse branch by branch.

The second job is the opposite one. Switch to minify and the same document comes back stripped of every optional byte, ready to paste into a config file or an environment variable. A json minifier and a beautifier are the same tool pointed in two directions, so both live behind one button here.

Nothing is uploaded. When you open a file, the page reads it with the browser's own FileReader and hands the text to a background worker; the bytes never leave the machine. Some tools that format json online post your document to a server first — which matters when the document is an access token, a customer record, or a bug report from production. A JWT carries its JSON Base64url-encoded: decode the middle part with the Base64 decoder first, then paste the result here.

JSON Viewer: Reading a Document Instead of Formatting It

Plenty of people who land here do not want to change anything. They want a json viewer — a way to open a payload and understand its shape. That is what the Tree tab is for: every object and array collapses, so you can fold away the parts you do not care about and follow one branch down to the value you came for.

It handles the whole family of that request. To view json from an API response, paste it. As a json file viewer, open a .json from disk — the same thing people search for as a json viewer file or a json document viewer. As a json object viewer, expand a single node and read its keys without the surrounding noise. Working as a json reader rather than an editor is half of what this page is for, which is why the tree is a tab and not a footnote. If you were looking for a json viewer online, a json reader online, or a json format reader, this is it.

JSON Validator and Linter

Press Format on something broken and you get a position, not a shrug: the line and column where parsing stopped, and the text of the error. Most malformed documents fail for one of four reasons — a trailing comma, a single quote where a double quote belongs, an unquoted key, or a missing closing brace — and the line number usually points straight at it.

This is the json validator half of the page, and it needs no separate button: formatting a document proves it parses. Use it as a json checker before committing a config, as a json linter in place of a build step, or to check valid json online when an API is rejecting your body and you want to know whether the fault is yours. Searches for a json checker online, a json verify step, quick json verification, a json corrector online, or a json parser online all describe this same check — with one honest caveat: it reports where a document breaks, it does not guess what you meant and repair it.

Because validation and formatting are one action, the page works as a json formatter and validator in a single pass — written by some as a json formatter & validator, and by search engines as json formatter on line or plain json online. Opening a document from disk makes it a json file formatter; pasting one object into the box and pressing Format is what people mean by format json object online. Used as a lightweight json editor online, it will reformat what you paste and tell you the moment an edit breaks the syntax.

Large Files

Parsing runs in a Web Worker, so a heavy document does not freeze the tab while it is being read. Rendering is the part that does not scale, and rather than pretend otherwise this page changes what it shows as the file grows:

Numbers Longer Than 15 Digits

JavaScript stores every number as a 64-bit float, which represents integers exactly only up to 9,007,199,254,740,991. A larger one — a Twitter-style ID, a Snowflake, a 64-bit database key — is silently rounded the moment it is parsed, and rounded values are written back out. This page scans for such numbers before formatting and warns you when it finds one, because the failure is otherwise invisible: the document still parses, the ID is just quietly wrong by a few units. When that matters, keep those values as strings.

Sorting Keys

Object key order carries no meaning in JSON, but it makes diffs noisy: two servers can return the same object with the keys in different orders and produce a diff hundreds of lines long. Sorting both sides alphabetically first collapses that to the changes that actually matter.

Questions