Local browser tool

JSON Formatter & Validator

Paste JSON to pretty-print, minify, or validate it. Choose the indentation, sort object keys recursively, and copy or download the result — without the document leaving your browser.

All processing happens locally in your browser. Your input is never uploaded.

0 characters · 0 bytes (UTF-8)

Result

How this JSON formatter works

Formatting versus minifying

Format re-serializes the parsed document with one property per line and your chosen indentation (2 spaces, 4 spaces, or tabs), which makes structure and nesting easy to read in code review or debugging. Minify removes every insignificant space and line break, producing the smallest equivalent document for transfer or storage. Both operations parse first, so the output is always well-formed JSON with the same data.

Validation behavior

Validate checks the input against the JSON grammar using the browser's native parser. When parsing fails, the tool shows the parser's message and, when the browser reports a position, the line and column of the first error. Invalid input is never auto-corrected or partially formatted: the tool either outputs a faithful re-serialization of valid JSON or tells you exactly why it cannot.

Recursive key sorting

With Sort object keys recursively enabled, every object at every depth has its keys ordered by Unicode code-unit comparison, which makes documents diff-friendly and stable across systems. Array order is data, so arrays are never reordered. One JavaScript quirk applies: keys that look like array indexes (such as "2") always serialize before other keys, in ascending numeric order.

Number precision

JSON numbers are parsed as 64-bit floating-point values, as in every browser. Integers beyond ±9,007,199,254,740,991 (Number.MAX_SAFE_INTEGER) can lose precision — for example, 9007199254740993 re-serializes as 9007199254740992. This tool does not provide arbitrary-precision numbers; keep IDs of that size as strings if exact digits matter.

Privacy

The formatter runs entirely in your browser: parsing, formatting, sorting, byte counting, copying, and the .json download are all local operations. This site never uploads, logs, or stores your input, and the result is rendered as plain text, never executed. See the privacy policy for the website-wide details.