Skip to the JSON editor
JSON Formatter Viewer

JSON formatter, viewer, and validator

Paste JSON to format, validate, beautify, or minify it, then explore the result as a collapsible tree. Everything runs in your browser. Nothing is uploaded.

input.json

Paste your JSON here

or drop a .json file anywhere here

Formatted output appears here.

Waiting for input

A JSON tool, not a text box with a button.

Everything below is part of the editor above — there is no upsell and no second page to visit.

Format and minify

Pretty-print with 2 spaces, 4 spaces, or tabs, or strip every byte of whitespace. The size before and after is shown so you can see what you saved.

Errors you can act on

Invalid JSON reports the line, the column, the offending source line with a caret under it, and a plain-language explanation of what the parser expected.

Repair near-JSON

Trailing commas, single quotes, unquoted keys, // comments, Python True/None, JSONP wrappers, and newline-delimited JSON are all recoverable in one click.

A tree that scales

Nodes render only when you open them and long arrays load in chunks, so a multi-megabyte document expands without locking the tab.

Search the whole document

Search walks the parsed data rather than the visible DOM, so matches inside collapsed branches are still found — then the tree opens to reveal them.

Table view for record arrays

An array of objects becomes a sortable-width grid with the union of every key as columns, and exports to CSV in one click.

Copy any value or path

Every tree row copies its own value, or the JSONPath expression that reaches it — $.limits.retry.attempts — ready to paste into code.

Statistics on every parse

Object and array counts, total and unique keys, value counts, maximum nesting depth, and document size, recalculated as you type.

Keyboard-first, no chrome

No ads, no cookie banner, no sign-in wall, no “save online” prompt. Every action has a shortcut and the tree follows the ARIA tree pattern.

What a JSON formatter does here

A JSON formatter parses a document and writes it back out with newlines and indentation, so a payload that arrived as one long line becomes something you can read. On this page the same pass also validates: input that parses is re-indented and rendered as a tree, and input that does not stops at the first syntax error with the line, column, and offending character named. Formatting only touches the whitespace between tokens — your keys, values, and order come back unchanged.

Parsing uses your browser’s own JSON.parse, so the document is never sent anywhere and the tool keeps working with the network disconnected.

How to format JSON online

  1. Paste JSON into the input pane, or press Upload to open a local file.
  2. Press Format and pick 2 spaces, 4 spaces, or tabs from the indent selector. Minify strips the whitespace back out again.
  3. Read the output as a Tree to click through nested objects, asText for the indented source, or as a Table when the document is an array of records.
  4. If it will not parse, press Repair — trailing commas, single quotes, unquoted keys, and comments are all recoverable — then format the result.

That covers API responses you are debugging, configuration files, log lines with JSON embedded in them, and fixtures you are checking before they go into a test.

Pages for a single job

Every page below runs this same editor, opened on the panel that suits the task and written up in more depth: the JSON formatter covers indent choices and the equivalent jq and Python commands, theJSON validator catalogues the syntax errors developers hit most often, the JSON viewer explains searching and path copying in large documents, the JSON beautifier deals with minified and escaped input, and the JSON minifier shows what whitespace actually costs in bytes. There is alsoJSON pretty print for key sorting, aJSON diff that compares two documents by path, and converters forJSON to CSV, JSON to YAML, andJSON to XML.

Common questions about JSON formatting

What is the best JSON formatter online?

The right one is whichever handles your document without getting in the way. Worth checking before you settle on one: does it validate as well as indent, does it name the exact line and column when parsing fails, can it open a multi-megabyte file without freezing the tab, and does your data leave the browser? This page formats, validates, beautifies, and minifies JSON, then shows the result as a collapsible tree, a table, or indented text — with no account, no ads, and no upload, because every parse runs locally on your own machine.

What is JSON formatter?

A JSON formatter is a tool that parses a JSON document and writes it back out with consistent newlines and indentation, turning a single-line API response into something a person can read. Because it has to parse the input first, a formatter is also a validator — anything that will not parse stops with an error instead of being reformatted. Formatting only changes the whitespace between tokens, so your keys, values, types, and order come back exactly as they went in.

What is the difference between a JSON formatter and a JSON validator?

A formatter answers “how do I read this?” and a validator answers “is this correct?”. The same parse does both, which is why this page reports syntax errors while it formats. The separate JSON validator is for when checking is the whole job: it opens on the error panel and gives the line, the column, the offending source line with a caret under it, and a plain-language note about what the parser expected. Neither checks your document against a JSON Schema — that is a question about shape, not syntax.

How do I fix invalid JSON?

Start at the reported position, because most failures are a single character. The usual culprits are a trailing comma before } or ], single quotes instead of double quotes, unquoted property names, // comments, and Python’s True/False/None — all legal in JavaScript or Python, none of them legal in JSON. Press Repair and each of those is rewritten, along with JSONP wrappers and newline-delimited records, so you can format the result straight away.

How do I minify JSON, and when is it worth doing?

Paste the document and press Minify: whitespace between tokens is stripped and the size before and after is shown, so you can see what you actually saved. It pays off for payloads you are about to send over the wire or store, and costs you nothing to undo — Format reverses it exactly, byte for byte. The JSON minifier opens directly on that view.

Can I view and search a large JSON document as a tree?

Yes. The tree view expands and collapses any branch, and search walks the parsed data rather than the visible DOM, so a match buried inside a collapsed object is still found and the tree opens to reveal it. Every row copies its own value or the JSONPath that reaches it. Rows are built only when you open them and long arrays load in chunks, which is what keeps a big document responsive. The JSON viewer goes into more detail.

Is this a free JSON formatter, and do I need a browser extension?

It is free, with no sign-in and no cap on how many documents you run through it. No extension is needed either — this is an ordinary web page, and because parsing happens in your browser rather than on a server it keeps working after you go offline. Alongside formatting there is a JSON beautifier for minified or escaped input and a JSON diff for comparing two documents by path.

Data handling

Your JSON never leaves this browser.

Most online formatters POST your document to a backend to format it. This one does not need to — everything a JSON tool has to do is already available client-side.

Parsing happens in your tab

Your JSON is handed to the browser’s own JSON.parse. There is no API call, no server round trip, and no request that carries your document.

Nothing is uploaded

Upload and drag-and-drop read the file with the local File API. The bytes never leave the machine — you can format JSON with the network disconnected.

No third-party requests

No analytics, no ad network, no CDN calls, no embedded widgets. Fonts are compiled into the site at build time, so the page loads only from this origin.

One local convenience

Your most recent document is kept in this browser’s localStorage (up to 500 KB) so a refresh does not lose your work. It stays on your device, and Clear removes it.

Verify it yourself: open your browser devtools, switch to the Network tab, and format a document. You will see no requests. Or load the page, go offline, and keep working.

Keyboard shortcuts

Every action has a keyboard path. The tree follows the ARIA tree pattern, so arrow keys move between nodes without touching the mouse.

KeysAction
Ctrl / ⌘ + EnterFormat and pretty-print the document
Ctrl / ⌘ + Shift + MMinify the document
Ctrl / ⌘ + KFocus the tree search box
Enter / Shift + EnterNext / previous search match
Ctrl / ⌘ + Shift + CCopy the output
Ctrl / ⌘ + SDownload the output
TabInsert indentation in the editor
↑ ↓ ← →Move, expand, and collapse tree nodes

Questions developers actually ask

Is my JSON uploaded to a server?

No. The page calls the browser’s built-in JSON.parse, and file upload uses the local File API. There is no backend involved in formatting, validating, or viewing. You can disconnect from the network after the page loads and everything still works.

What is the difference between formatting, beautifying, and pretty printing JSON?

Nothing — they are three names for the same operation: re-serialising JSON with newlines and indentation so a human can read it. The output is byte-identical whichever page you start from.

How large a file can it handle?

Documents of several megabytes are comfortable. The tree only builds DOM for nodes you open, and arrays load 200 children at a time. Above roughly 1.5 MB the editor stops re-parsing on every keystroke and waits for you to press Format, so typing stays smooth.

Why does my JSON fail validation when it looks fine?

The usual causes are a trailing comma before a closing bracket, single quotes instead of double quotes, unquoted property names, // comments, or Python’s True/False/None. All of these are valid JavaScript or Python but not valid JSON. Repair fixes each of them.

Does it validate against the JSON spec?

Validation uses the browser’s own parser, which implements RFC 8259 / ECMA-404. That is the same parser your application code will use, so a document that passes here will parse in production.

Can I sort JSON keys?

Yes. Sort keys orders object properties A→Z at every level of nesting. Array order is data rather than formatting, so it is left untouched.

What is stored in my browser?

Your most recent document (up to 500 KB), your indentation choice, your view preference, and your theme — all in localStorage on your own device, so a reload does not lose your work. Clear removes the document.

How do I un-escape JSON that is stored inside a string?

Paste the quoted string and press Unescape. A log line like "{\"id\":7}" becomes real JSON you can browse in the tree.

Focused pages for each task

Same engine, same privacy — every page runs entirely in your browser.