JSON Formatter, Validator & Minifier
Format, minify, sort and validate JSON entirely in your browser — with exact line/column error locations and a warning when a number is too large to keep its precision.
Runs in your browser; nothing is uploaded.
Runs in your browser; nothing is uploaded.
Paste or open a JSON file, then choose Format or Minify (Ctrl/⌘+Enter formats).
How to use it
How to use the JSON formatter
Paste JSON into the input box, or use Open file to load a
.jsonfile (up to 5 MB).Choose an indent width (2 spaces, 4 spaces, or a tab) and, optionally, turn on Sort keys to order every object's keys alphabetically at every nesting level.
Select Format to pretty-print, or Minify to strip all whitespace down to the shortest valid JSON.
If the input isn't valid JSON, the tool reports the exact line and column of the first character it couldn't parse, instead of a generic "invalid JSON" message.
Copy the result with Copy, or save it with Download.
Everything happens in your browser tab. The JSON you paste, and the file you open, are never sent anywhere — there is no upload, no network request, and no server-side processing.
A note on big numbers
JavaScript (and therefore every browser-based JSON tool) stores numbers as 64-bit floating point values, which can only represent integers exactly up to 2^53. An integer like 9007199254740993 (2^53 + 1) can't be represented exactly and silently rounds to the nearest value it can store. The formatter detects this and shows a warning next to the result instead of letting the rounding pass unnoticed — useful when you're inspecting a payload that carries large database IDs or Snowflake-style identifiers as JSON numbers rather than strings.
Frequently asked questions
Does this tool send my JSON anywhere?
No. Parsing, formatting, minifying and validation all run in your browser using JavaScript that ships with the page. Nothing you paste or upload is sent to a server, logged, or stored — closing the tab discards it completely.
Why does it show a line and column number instead of just "invalid JSON"?
A vague error forces you to scan the whole document by eye. This tool parses JSON itself and reports the exact 1-based line and column of the first character that broke the grammar — for example a trailing comma before a closing brace — so you can jump straight to the problem.
What does "Sort keys" actually do?
It reorders every object's keys alphabetically, at every level of nesting, before printing the result. It's useful for diffing two JSON documents that contain the same data in a different key order, since a stable order removes that noise from the comparison.
Why did I get a precision warning on a number that looks fine?
JavaScript numbers are IEEE-754 doubles, which only represent integers exactly up to 2^53 (9,007,199,254,740,992). An integer literal beyond that, such as a 64-bit database ID sent as a JSON number, silently rounds. The tool flags this instead of hiding it.
Is there a file size limit?
Loading a file through Open file is capped at 5 MB to keep the tab responsive, since parsing and re-printing both happen synchronously in your browser. Pasted text has no hard cap, but very large documents will naturally take longer to format.