Skip to content
Foxipa

JSON tool

JSON Formatter

Beautify, minify, validate, and explore JSON directly in your browser — precise error locations, a collapsible tree view, key sorting, and live statistics. Nothing leaves your device.

Ready 0 chars 0 lines
INSPECTOR

JSON tools

Format & minify

Sort keys

Sorts object keys recursively at every level. Array order is data and never changes.

Clean

Removes comments and trailing commas, turning relaxed JSONC into strict JSON.

Statistics

objects
—
arrays
—
strings
—
numbers
—
booleans
—
nulls
—

Paste or import JSON and work with it directly in your browser. Foxipa’s JSON Formatter pretty-prints messy documents, minifies them for transport, validates them as you type, and lets you explore their structure in a collapsible tree — all without sending a single byte to a server.

Format and minify with the indentation you need

Turn a wall of minified JSON into a readable document with one click, using 2 spaces, 4 spaces, 8 spaces, or tab indentation. Minify strips every unnecessary byte for APIs, storage, or embedding — then Format brings it back. Both operations are full undo/redo history entries, so experimenting costs nothing. The keyboard shortcut Ctrl+Enter (or Cmd+Enter on Mac) formats without leaving the editor.

Validate with errors you can act on

The status bar validates on every keystroke using a strict RFC 8259 scanner, so the moment your document stops being valid JSON you know it. Errors report the exact line and column with a specific diagnosis — an unterminated string, a trailing comma, a missing colon, an invalid escape sequence — and the Go to error button jumps the cursor straight to the offending character. No more counting braces by hand.

Explore the structure in a tree view

Switch to the Tree view to walk the document as a collapsible hierarchy: objects and arrays expand and fold, every node shows a preview and its item count, and focusing a node prints its full path — $.store.book[0].title — ready to copy into a bug report or a JSONPath expression. The tree follows the standard ARIA tree keyboard pattern: arrow keys move and expand, Home and End jump to the boundaries. Expand all and Collapse all handle wide documents in one click.

Sort keys and clean relaxed JSON

Sort keys orders object names recursively — a10 correctly after a9 thanks to natural ordering — while arrays keep their order, because array order is data. Sorting makes configuration files and API responses easier to scan and makes diffs between documents meaningful. Clean recovers strict JSON from the JSONC dialects that config files often use: // line comments, /* block */ comments, and trailing commas are removed while string contents stay untouched.

Live statistics as you edit

The status bar tracks characters, lines, keys, and maximum nesting depth on every keystroke, and the statistics card breaks the document down into objects, arrays, strings, numbers, booleans, and nulls. Watching a key count drop after removing a duplicated block is a quiet but effective review technique.

Import, export, and share without an account

Import opens a .json, .jsonc, or .txt file from your device; Download saves the current document as data.json; Copy puts it on the clipboard; and the share button packs the document into the link itself — the URL fragment is never sent to a server. Your work is also saved automatically in your browser, so an accidentally closed tab costs nothing. Reset returns the starter example and clears the stored state.

Privacy and performance

There is no server-side formatting endpoint. Parsing, validation, sorting, cleaning, tree building, and serialization all run locally in your browser, and the editor is a real CodeMirror instance with syntax highlighting, code folding, bracket matching, search, and multi-cursor editing. Very large documents keep working in the editor; the tree view deliberately steps aside past a generous size limit instead of freezing the page.

Frequently asked questions

Does the JSON Formatter upload my data? No. Everything runs locally; nothing is transmitted, logged, or stored outside your browser.

What JSON dialects does Clean support? It removes // and /* */ comments plus trailing commas — the common JSONC relaxation. It does not guess at single-quoted strings or unquoted keys, because silent rewrites of ambiguous input are worse than an honest error message.

Why does the validator reject trailing commas? Strict JSON (RFC 8259) does not allow them. The scanner tells you exactly where they are, and Clean removes them in one click.

Can it handle big files? Yes — the editor streams comfortably through large documents. Beyond a generous node limit, the tree view shows a notice instead of rendering, keeping the page responsive.

Is the formatting standard? Yes: formatting and minification use the same serialization rules every JSON tool expects, with your choice of indentation. Numbers follow the platform’s canonical number formatting.