Minify JSON
Strip every optional byte from a JSON document and see exactly how much you saved. The input is parsed first, so a result also proves validity.
- Runs in your browser
- Files are never uploaded
- Free, no account
Your JSON never leaves this tab — check it yourself—
Starting the network probe…
The counter above wraps fetch, XMLHttpRequest and navigator.sendBeacon in this tab and counts every call. It does not block anything — it just reports.
Two ways to verify independently
- Turn off Wi-Fi or enable airplane mode, then use the tool. It keeps working, because the page is already fully loaded.
- Open your browser devtools, switch to the Network tab, clear it, and run the tool. No new row appears.
Why this matters
In 2025 researchers found that popular online formatters had retained tens of thousands of user-submitted snippets — JSONFormatter.org and CodeBeautify together exposed roughly 80,000 saved documents, many containing live cloud credentials, private keys and internal database connection strings, because “format this” quietly meant “upload this”. A separate incident exposed roughly 3.5 million user PDFs on a document-conversion service. The only structural fix is not sending the data in the first place: this site is served under a Content-Security-Policy whose connect-src contains no third-party origin, so a request off this device cannot be made even by accident.
What minifying JSON removes
Only insignificant whitespace: the spaces, tabs and newlines between tokens that a pretty printer added. Nothing inside a string is touched, no key is reordered, and no number is rewritten. Because this tool parses the document and re-serialises the parsed value, the output is guaranteed to be valid JSON that represents exactly the same data — an invalid input produces an error rather than a mangled string.
The honest performance answer
Minification saves a lot of raw bytes and very few transferred bytes. Indentation is the most compressible thing in a text file: it is long runs of identical characters in predictable positions, which is precisely what gzip and Brotli eliminate almost for free. A document that loses 28% of its size to minification will typically lose only 3–6% after Brotli.
So minify when the limit is on uncompressed bytes:
- A database column with a length cap.
- A message-queue or webhook payload size limit (SQS 256 KB, EventBridge 256 KB, Lambda 6 MB synchronous).
- A cookie, a URL query parameter, or a header value.
- localStorage, which is quota-limited per origin and stores strings uncompressed.
- An embedded device with a fixed receive buffer.
Do not minify a static .json file served over HTTP purely for speed; enable
compression on the server instead and keep the readable version.
Sorting keys before minifying
Object member order carries no meaning in JSON, but every byte-level comparison — a checksum, a cache key, a text diff — treats a reordered document as a different one. If you are hashing JSON to detect change, or comparing two API responses that were serialised by different runtime versions, turn on Sort keys A→Z first. Array order is meaningful and is never touched.
Numbers survive, formatting does not
One thing to know before minifying a document you intend to compare against the original: the
round trip normalises number formatting. 1.50 becomes 1.5,
1e3 becomes 1000, and -0 becomes 0. The
values are identical; the text is not. If you need byte-identical numeric formatting — for a
signature over a canonical form, for example — do not round-trip through a parser at all.
Minifying very large files
The whole document is parsed in memory, so the practical ceiling is your device rather than an upload limit. Tens of megabytes are fine on a desktop browser; a phone will struggle earlier. Use the file button rather than pasting for anything over a megabyte — pasting a large document into a textarea is slower than reading the file directly.
Questions
How much smaller does JSON get?
Typically 15–30% for a formatted document, and much more for deeply nested data indented with four spaces. The exact figure for your file is shown above the output.
Will minifying make my API faster?
Less than you would expect. Gzip and Brotli compress repeated indentation extremely well, so on a compressed transport the saving after compression is often only a few percent. Minify for hard byte caps — a database column, a message-queue payload limit, a URL parameter — not as a general performance measure.
Is minified JSON still valid?
Yes. Whitespace between tokens is insignificant in JSON, so both forms parse to exactly the same value. This tool parses your input, then re-serialises the parsed value, which is why an invalid input produces an error rather than a mangled string.
Does key order change?
No, unless you turn on the sort switch. Object member order carries no meaning in JSON, but it is preserved by default so a diff against the original stays readable.