JSON Minifier
Compress a JSON document to one compact line and see how many bytes you saved.
Processed locally in your browser/ Your data stays in your browser.
What is JSON Minifier?
Minifying JSON removes every character that carries no meaning: spaces, tabs and line breaks between tokens. The data is identical, but the text is shorter, which helps with request size, storage and copy-pasting into a single-line field.
The tool validates the document first, then prints it without any whitespace outside of strings. Numbers and escape sequences inside strings are kept exactly as you wrote them, and a small report shows the original size, the minified size and the percentage saved.
How does it work?
- Paste your formatted JSON in the input area.
- The minified single-line result appears immediately, with the size before and after.
- If the JSON is invalid, fix the position shown in the error message (line and column).
- Copy the result or download minified.json.
Common use cases
- Embedding a JSON config in an environment variable, a CSV cell or a URL parameter.
- Reducing the size of a JSON fixture stored in a repository or sent in a test request.
- Producing one-line JSON logs or JSON Lines records from a pretty-printed sample.
- Comparing two documents by stripping formatting differences first.
Examples
Try this input in the tool above:
{
"name": "Ada Lovelace",
"born": 1815,
"fields": [
"mathematics",
"computing"
],
"active": false
}{"name":"Ada Lovelace","born":1815,"fields":["mathematics","computing"],"active":false}Privacy
JSON Minifier runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.
Limitations
Minification only removes whitespace: it does not shorten keys or compress data. For network transfer, gzip or Brotli saves far more.
Frequently asked questions
Can minifying break my JSON?
No. Only whitespace outside strings is removed, so the parsed data is identical. Spaces inside string values are never touched.
How much smaller will my file get?
It depends on the indentation. Deeply indented, pretty-printed files often shrink by 20–40%, while an already compact file changes very little. The tool displays the exact saving.
Are key order and big numbers kept?
Yes. Keys stay in their original order and numbers keep their exact digits, including integers larger than JavaScript can represent exactly.
Related tools
JSON Formatter & Beautifier
Turn a minified or messy JSON document into readable, consistently indented text, with a precise error message if the JSON is invalid.
JSON & Data
JSON Validator
Check whether a piece of text is valid JSON and locate the exact character where it goes wrong.
JSON & Data
JSON Escape
Turn any text, even a whole JSON document, into a safe string you can embed inside another JSON value.
JSON & Data
JSON Repair
Paste almost-JSON from a log, a chat answer or a JavaScript snippet and get valid JSON back, with a clear report of every change.
JSON & Data
JSON Key Sorter
Reorder the keys of every JSON object alphabetically to get a stable, canonical document.
JSON & Data
JSON Viewer
Explore a JSON document as an expandable tree instead of a wall of text, with a summary of its structure.
JSON & Data
JSON Size Calculator
Paste a JSON document to see how many bytes it really weighs, how much minifying and gzip save, and which values take the most space.
JSON & Data