JSON Formatter & Validator

Paste JSON to format, validate or minify it — entirely in your browser. Big numbers keep every digit, duplicate keys get flagged, and files never leave your device.

Files never leave your device
0

What This Tool Does

Paste JSON, drop a file, or type it directly, then format, validate, or minify it — entirely in your browser. A WebAssembly module built from Rust does the parsing and rewriting inside your browser tab, so your JSON is never uploaded to a server: nothing about its contents leaves your device at any point.

Tip: Not sure whether your input is even valid JSON? Just click Format — a parse error names the exact line and column where things go wrong, and if the input is valid, any warnings about duplicate keys or numbers beyond JavaScript's safe range show up right under the result.

How to Use It

Paste your JSON into the input box, or load it from a file. Pick an indent width (2 spaces, 4 spaces, or a tab), or switch on Minify to collapse everything onto one line instead. Turn on Sort keys if you want every object's keys arranged alphabetically. Click Format, then read the result: a clean parse shows your formatted output plus any warnings, while invalid JSON shows the exact line and column where parsing failed. Copy the result or download it once you're happy with it.

Why Numbers Survive Here

Open a very large integer like 12345678901234567890 in a typical browser-based JSON tool and watch what comes back out: 12345678901234568000. The last several digits are gone, replaced with zeros, even though nothing in the tool's UI ever warned you. That happens because most JSON tools parse with JavaScript, and JavaScript represents every number — however it's written in the source — as a 64-bit floating-point double. A double can only carry about seventeen significant digits safely, so anything longer gets silently rounded to the nearest value a double can represent, and re-serializing that rounded value produces a different number than the one you typed in.

This formatter avoids that entirely by parsing with Rust's serde_json library in arbitrary-precision mode, which keeps each number's exact source text instead of converting it to a double first. A giant integer like the one above, or a long decimal with twenty significant digits, comes back out exactly as it went in — byte for byte, digit for digit. The one place this can't help you is downstream: if you copy the formatted output into a tool that itself uses JavaScript numbers, that tool will still round it. The guarantee here is only that this formatter itself never introduces that corruption.

Duplicate Keys: Last Value Wins, With a Warning

JSON's grammar technically allows the same key to appear more than once inside a single object, even though most people never write JSON that way on purpose. When it happens, every JSON parser — including the browser's own JSON.parse — resolves it the same way: the last value written for that key wins, and every earlier value for the same key is silently thrown away. This formatter follows that identical rule, so its output always matches what any other standard JSON parser would produce.

What it adds is visibility. Before formatting, the input is scanned specifically for repeated keys, and if one turns up, a warning names the key and the exact path to the object it appeared in — so you find out a value was dropped instead of only noticing later that a field held a value you didn't expect.

Formatting Options

  • Indent — choose 2 spaces, 4 spaces, or a tab for pretty-printed output.
  • Minify — collapse the entire document onto a single line with no extra whitespace, for the smallest possible output.
  • Sort keys — reorder every object's keys alphabetically, recursively through the whole document, regardless of how they were ordered in your original input.

Minify and Sort keys are independent of each other: switching on Minify by itself never reorders anything, it only removes whitespace. Your keys stay in the exact order you wrote them unless Sort keys is also turned on.

Limits

Input is capped at 10 MB. A file or pasted text past that size is rejected immediately with a clear message, before any parsing is attempted, so you're never left waiting on a browser tab that's silently run out of memory.

Where to Go Next

If you need to pull specific fields out of a JSON document, reshape an array of objects, or filter records by a condition rather than just format one, the jq tool runs real jq-style filters on your JSON in the same browser-only way — worth knowing, though, that jq's own number handling isn't byte-exact the way this formatter's is, so for reformatting without any risk to large numbers, this page remains the one to use.

Frequently asked questions

Is my JSON file or text uploaded anywhere?
No. Formatting, validating and minifying all happen through a WebAssembly module running inside your browser tab. Your JSON is parsed and rewritten entirely on your own device — nothing is sent to a server, and nothing about its contents leaves your machine.
Why do big numbers get corrupted in other JSON tools but not here?
Most browser-based JSON tools parse with JavaScript's built-in JSON.parse, and JavaScript stores every number as a 64-bit floating-point double. That format only carries about seventeen safe significant digits, so a long integer or a long decimal silently loses its tail end of digits the moment it's parsed. This tool parses with Rust instead, keeping each number's exact source text, so nothing gets rounded away.
What does the duplicate-key warning actually mean?
JSON technically allows the same key to appear twice inside one object, and when that happens the last value written wins — the earlier one is silently discarded. This tool follows that same last-value-wins rule so your formatted output matches what every other JSON parser produces, but it also scans your input for repeated keys first and shows a warning naming the key and where it sits, so you know a value was dropped instead of finding out the hard way later.
Is there a size limit on the JSON I can format?
Yes — up to 10 MB. A file or pasted text past that size is rejected up front with a clear message, rather than letting your browser tab freeze partway through parsing something too large for a single tab to handle comfortably.
Does turning on Minify change the order of my keys?
No. Minify only strips whitespace and line breaks — it keeps every key in the exact order it appeared in your original JSON. The only thing that reorders keys is the separate Sort keys option, which arranges every object's keys alphabetically, recursively, whether or not Minify is also switched on.