Skip to content
cliplimeClipLime

Minify JSON

Remove the spaces and line breaks from JSON and see how many bytes you save. Strings and numbers are never touched.

Your text is processed in this tab and never uploaded

Options

Read JSONC, as used in config files. Comments are dropped from the result.

0 characters, 0 lines Your text stays in this tab.

Numbers and strings are kept exactly as you wrote them, so long IDs and values like 1.0 are not rounded or rewritten.

At a glance

What it removes
Spaces, tabs and line breaks that sit between values. Nothing inside a string is touched.
What it keeps
Every string and number exactly as written, and the order of keys unless you ask for sorting.
Checks as it goes
Invalid JSON gets a line and column instead of a broken result.
Size line
Shows the size before and after in bytes, and the percentage saved.
Options
Optional A to Z or Z to A sorting of property names, and a relaxed mode that drops comments.
Reversible
Run it through the formatter to read it again. Sorting and removed comments cannot be undone.
Privacy
Runs in your browser tab. Your JSON is never uploaded.

How to do it

  1. 1

    Paste your JSON

    Paste into the left box or drop a .json file on it. The minified result appears on the right as you type.

  2. 2

    Check the size line

    Under the result you see the bytes before and after and the percentage saved.

  3. 3

    Copy or download

    Press Copy or Download. The file is saved as minified.json.

What minifying removes, and what it keeps

Minifying JSON means deleting the white space that is only there for people: indentation, line breaks, and spaces after colons and commas. The data stays the same.

  • Spaces inside strings stay, including line break escapes such as \n.
  • Numbers stay as written. 1.0 stays 1.0 and 1E+5 stays 1E+5. Tools that read the JSON into values and write it back shorten them, which changes the text of your data. Removing white space does not.
  • Property order stays as written, unless you turn on sorting.
  • Duplicate keys stay, with a warning, because deleting one would change the data.

Because the JSON is read in full first, a missing comma or a stray quote is reported with its line and column, and you do not get half a result.

When to minify and when to leave it readable

Minify when the text is sent or stored somewhere that costs per byte: a request body, a value in an environment variable, a cookie, local storage, a query parameter, or text you encode into a QR code.

Leave it readable when people edit or review the file. A minified file is one long line, so every change shows up as a change to the whole line in version control. Format files that live in a repository, and minify at build time if you need to.

On the network the gain is smaller than it looks, because servers usually compress responses with gzip or Brotli, and compression handles repeated white space well. Minifying helps most where text is stored or sent without compression.

Getting readable JSON back

Open the JSON formatter and paste the minified text to indent it again. You get a readable layout, though not your original indentation.

Two things cannot be undone: sorted property order, and comments removed by the relaxed mode. Keep the original if you need either.

Questions people ask

Does minifying change my data?

No. Only white space between values is removed. Strings, numbers, booleans, nulls and the structure are copied exactly. The one exception is sorting, which changes the order of property names, and it is off by default.

Why did the size barely change?

The JSON may already be minified, or most of its bytes may be inside strings, which are never changed. Data that is mostly long text has little white space to remove.

Does it remove comments?

Standard JSON has no comments, so they are reported as errors. If your file is JSONC, turn on Allow comments and trailing commas. Comments and trailing commas are then dropped from the minified result.

Can I minify and sort at once?

Yes. Choose A to Z or Z to A under Sort property names. Sorting by character code at every level gives the same text for objects that list the same keys in a different order, which makes two files easier to compare.

How large a file can it minify?

Up to 2 million characters the result updates while you type. Larger text waits for the Minify now button. The practical limit is your device's memory.

Is my JSON uploaded?

No. Everything runs in your browser tab.