Skip to main content

Data

JSON Minifier

Strip every space and newline from a JSON document for compact storage or transport.

Runs in your browserPrivate by designJSONJSON
JSONJSON

Press ⌘ Enter to run

4 lines · 124 chars

Ready — press Run or ⌘ Enter

How this tool handles files

Processing
In your browser, on-device
Storage
Nothing stored
Output
A file you download
Your responsibility
Review before official use
  • Runs in your browser. Your file is processed on your own device and, on this site, is not uploaded to our servers.
  • Nothing is stored. Your file and its output are gone the moment you close or reload the page.
  • Review sensitive files (bank, ID, medical) and check the output before sharing it.

Every tool on FormatOS runs in your browser. Read our Privacy Policy and File Handling Policy.

Common uses

  • Shrink JSON before storing or sending
  • Prepare JSON for embedding in URLs

Limitations

  • Input must be valid JSON

When stripping JSON whitespace actually pays off

JSON Minifier removes the spaces, tabs, and line breaks that a formatter adds for readability, collapsing a document down to its smallest faithful form. It fits naturally into web and app development: trimming config files, fixtures, or seed data before they ship; shrinking API response samples and mock payloads stored in a repository; and reducing the byte count of JSON that travels over the wire or sits in a cache. Because indentation carries no meaning to a parser, removing it costs you nothing at read time.

It is also genuinely useful for data prep and sharing. If you need to embed a JSON blob inside a URL query string, a single-line environment variable, a CSV cell, or a database column, the minified single-line form is far easier to paste and move around than a multi-line one. Analysts and admins handing a snippet to a colleague, or pasting it into a ticket or chat, often want the compact version so it does not sprawl across the screen.

What it is not is a code minifier or a compressor. It only normalizes JSON layout; it does not rename keys, drop fields, or apply gzip-style compression. For transport savings, the meaningful win usually comes from HTTP compression on top of clean JSON, with minification as a modest, complementary step.

Paste in, parse, serialize, copy out

The flow is deliberately simple. You paste JSON into the input area in your browser, the tool runs, and you copy the result or download it as a file. Everything happens locally in the page — nothing is uploaded to a server and nothing is retained once you close the tab. This is a paste-based tool rather than a file-drop one, so very large documents are pasted as text rather than streamed from disk.

Under the hood it does not strip characters with a find-and-replace. It fully parses your input into a JSON value and then re-serializes it with no spacing, which is why valid input is a hard requirement: malformed JSON cannot be parsed and will not minify. A useful side effect of that round trip is that whitespace inside string values is preserved exactly, because only the structural formatting between tokens is removed.

Honest scope notes: it accepts standard JSON only. It does not handle JSON with comments, trailing commas, single-quoted keys, or other JSON5/JSONC extensions, and it has no options to sort keys, escape non-ASCII characters, or pretty-print — for the reverse, indented layout you would use the formatter instead.

Where it can surprise you

The most common stumbling block is invalid input. A stray trailing comma, an unquoted key, a comment, or a smart quote pasted from a document will all cause parsing to fail, so the source must be strict JSON. If your file is really JSONC or JSON5, strip those features first.

Because the tool parses and rebuilds the data rather than editing text in place, a few semantic changes can occur. Duplicate keys in the same object are not preserved — the last value silently wins, which can quietly drop data you assumed was there. Numbers are reserialized too, so representations may normalize: a trailing-zero or alternate exponent form can come out differently, and very large integers beyond JavaScript's safe range can lose precision. Key order for normal string keys is kept, but these value-level effects are worth knowing before you minify anything precision-sensitive.

Scale is the other limit. Since input is handled as in-memory text in the browser tab, extremely large documents (think tens of megabytes or more) can be slow or strain the page. For huge datasets, a streaming command-line tool is a better fit than a browser paste box.

Checking the output before you rely on it

Before using the result, confirm it is still valid JSON — re-formatting it or running it through a validator is the quickest check that the round trip succeeded. Spot-check a few values, especially any large numbers, decimals, or strings containing escaped characters, to make sure nothing shifted during reserialization. If your source might have contained duplicate keys, verify the fields you care about are all present, since only one value per key survives.

It is also worth a quick sanity check on what minification did and did not change: structure and key names should be identical to the original, only the spacing should differ. If the output looks shorter than expected in ways beyond whitespace, treat that as a signal to compare against your source rather than assuming it is correct.

For anything official, financial, or contractual, do not treat the minified file as automatically trustworthy. Compare it against the source — ideally by reformatting both and diffing them — and have a person confirm the data matches before it is submitted or stored as a record.

Frequently asked questions

All non-essential whitespace and line breaks between tokens. The data itself is unchanged — it just takes up less space for storage or transport.

Yes. Run the minified output through the JSON Formatter to get a readable, indented version back.

No. The conversion runs in your browser — your text or file is processed on your own device and, on this site, is not uploaded to a server, and we do not intentionally store it.

Related data tools

Tool last reviewed: June 30, 2026 · Report a problem