Free JSON minifier

Every unnecessary byte, gone.

Free JSON minifier. Paste any valid JSON and get back the smallest possible version, no line breaks, no indentation, right in your browser.

Paste your text to begin
0 chars / 0 words
bytes uploaded
0
usage limit
None
always
Free

JSON minifier

What the JSON minifier does

Paste any valid JSON, however it is currently formatted, spread across many lines, inconsistently indented, already partly compact, and this tool parses it and returns the smallest valid representation of the exact same data: no line breaks, no indentation, no spaces between tokens that do not need them.

It runs in your browser. Nothing you paste is uploaded, there is no signup, and there is no limit on how much JSON you minify.

The underlying fact

Why whitespace in JSON doesn't matter, in plain terms

JSON's grammar treats the spaces, tabs and line breaks between its structural characters, braces, brackets, colons, commas, as entirely optional. '{"a":1}' and a version of the same object spread across five indented lines describe exactly the same data to anything that parses it. The formatting exists purely for the person reading the file, never for the machine consuming it.

That is exactly what minifying takes advantage of: since none of that whitespace changes the meaning, removing every byte of it produces a file that is functionally identical to the original but smaller.

How it works

How to minify JSON in three steps

Nothing to configure, nothing to install.

Step 1
Paste your JSON into the input box, in whatever format it currently has.
Step 2
Press Minify. The tool parses and re-serialises it instantly, on your own device.
Step 3
Copy the compact result from the output box.

Why it matters

What minifying JSON actually saves you

The saving is pure byte count, nothing about the data's structure or meaning changes. For a payload embedded in a URL query parameter, a value stuffed into an environment variable, a script tag's inline data, or a '.min.json' asset shipped to every visitor of a website, every removed byte is one less byte to transmit and parse.

For a small, one-off object the difference is trivial. For a large configuration file, a sizeable API response used as a fixture, or an asset served to thousands of page loads, the removed whitespace adds up to a real, if modest, reduction in transfer size.

A side effect worth knowing

Why minifying also validates your JSON, and why that matters

To minify a value at all, this tool first has to parse it, which means anything that is not syntactically valid JSON, a trailing comma, an unquoted key, a comment, gets rejected outright with an error rather than silently mangled. That makes this tool a quick validity check as a side effect, even when saving bytes was not the point of pasting something in.

A common reason for that rejection is pasting JSON5 or JSONC, formats that allow comments and trailing commas and look almost identical to plain JSON. Standard JSON supports neither, so text copied from a config file written in one of those relaxed formats will fail here until the comments and trailing commas are removed.

Straight answer

Does valid JSON mean correct data?

No, and it is worth being direct about that. This tool confirms that what you pasted follows JSON's syntax rules, correctly matched braces and brackets, properly quoted keys, no trailing commas. It has no idea whether the values inside are the right values, whether a required field is missing, or whether a number should have been a string.

Syntactic validity and correctness are two different things. Minifying, or its counterpart, pretty-printing, only ever addresses the first one.

Who uses it

Who uses a JSON minifier, and when

Developers use it to shrink a config value that has to fit into a single environment variable, a URL parameter or a command-line argument. Front-end engineers use it to compact a small JSON asset before it ships to every page load, when a build tool's own minification step is not available.

Anyone preparing a JSON payload for a single-line log entry, a database column that does not handle line breaks well, or a chat message with a length limit uses it to compress the JSON down to one clean line without touching any of the actual data inside it.

FAQ

JSON minifier FAQ

Everything below is answered in full, nothing to click open.

How do I minify JSON?

Paste your JSON into the box above and press Minify. The compact, single-line version appears in the output box, ready to copy.

Is the JSON minifier free?

Yes. No signup, no paste limit, no usage limit, it runs entirely in your browser.

Is my data uploaded anywhere?

No. Parsing and minifying happen on your own device. Nothing is transmitted or stored.

Does minifying change any of my data?

No, only whitespace between structural characters is removed. Every key, value and array item stays exactly as it was.

Why does it say my JSON is invalid?

The text you pasted doesn't follow JSON's syntax rules, most often a trailing comma, an unquoted key, or a comment, none of which standard JSON allows.

Does it work on JSON5 or JSONC with comments?

No, standard JSON does not support comments or trailing commas, so text in those relaxed formats needs those removed first.

Does it sort or reorder my object keys?

No, keys stay in the exact order they appeared in your input. Minifying only removes whitespace, it doesn't reorganise anything.

Does it work on large JSON files?

Yes, there is no length cap and no run limit. Very large files depend on your own device's memory.

Does it work on phones?

Yes, the layout stacks on narrow screens.

What is the difference between this and the JSON prettifier?

This removes all unnecessary whitespace to make the file as small as possible. The prettifier does the opposite, adding indentation and line breaks to make it readable.

Does minifying validate my JSON is correct data, not just valid syntax?

No, it only confirms the syntax parses. It has no way to know if a value is wrong, a field is missing, or a number should have been a string.

Will minifying break my JSON in any way?

No, the result describes exactly the same data as the input. Minifying is a lossless transformation as far as the data itself is concerned.

Can I minify an array instead of an object?

Yes, any valid JSON value, an object, an array, a string, a number, minifies the same way.

Is there a batch mode or an API?

Not yet. Paste, minify, copy is the fastest route for now.

Does it remove comments from my JSON?

It can't, because standard JSON doesn't support comments in the first place, so any file containing them fails to parse rather than having them stripped.

Why would I minify instead of just deleting line breaks myself?

A manual find-and-replace can break string values that legitimately contain a line break or extra spaces. This tool parses the structure first, so it never touches the inside of a string value incorrectly.

Does it handle Unicode characters and emoji in my JSON correctly?

Yes, any valid JSON string content passes through unchanged, since minifying only affects whitespace between structural characters, not the string contents themselves.

Is my data safe to paste if it's confidential?

Yes, nothing is transmitted anywhere. Processing happens locally in your browser.

How much smaller does minifying actually make my file?

It depends entirely on how much whitespace the original had. A heavily indented, deeply nested file shrinks more than one that was already fairly compact.

Can I use the minified output directly in my code?

Yes, minified JSON is exactly as valid as pretty-printed JSON to any parser. The formatting change has no effect on how it's consumed.

Shrink your JSON to one clean line.

Paste, minify, copy. Nothing leaves your browser and there is no limit on how often you use it.

Minify my JSON