← All blog posts

JSON Minifier for homeowners and DIYers

WhiteUI · A plain-English guide to the JSON Minifier

Homeowners and DIYers do not only build with timber and paint: many also keep lists on their phones, set up smart-home gadgets, and store details about what they own. Some of those lists and settings are stored as JSON, and when a gadget or an app only accepts one line, the JSON Minifier packs the file onto a single line without changing a single detail. The examples below are the kinds of files a home actually produces.

At a glance

Home inventory: 31 of 111 bytes savedSaved 31 bytesKept 80 bytes111 → 80 bytes · 27.9% smaller
Minifying a home inventory file saves 31 of 111 bytes: the result is 80 bytes, which is 27.9 percent smaller.

A home inventory

Take a home inventory for the kitchen: a room label, kitchen, a list of three items, fridge, microwave and mixer grinder, and a year, 2024, for when the room was last painted. Written with two-space indenting across ten lines, the file is 111 bytes. Minified, it is 80 bytes, so 31 bytes are saved, or 27.9 percent. The list is the part that saves the most, because each item on its own line carries its own indenting and its own line break. The values are unchanged: the room is still kitchen, the list still holds the same three items, and the year is still 2024.

A price in rupees

An inventory often holds prices, and a price in rupees is a good example of why the tool counts bytes rather than characters. A small file holding an item, notebook, and a price, "₹500", is 45 bytes and minifies to 36 bytes, saving 9 bytes, or 20.0 percent. The rupee sign costs 3 bytes, so the string "₹500" is 8 bytes in total: one byte for each quote, three for the rupee sign, and one each for the three digits. The price is kept exactly as it was, because the tool never looks inside a quoted string.

A settings file for a gadget

Smart-home gadgets and apps keep their settings as JSON: a theme set to dark, a font size of 14, line numbers switched on, and a list of three add-ons, lint, format and git. Written with two-space indenting across eight lines, that file is 106 bytes. Minified, it is 87 bytes, so 19 bytes are saved, or 17.9 percent. Settings boxes in apps and gadgets often accept only one line, so the minified version is the one that pastes in cleanly, while the spread-out version is the one you keep for reading.

Why smaller matters at home

A smaller file is easier to send in a message, easier to paste into a small settings box, and easier to store when a gadget has little memory. The saving on one file is small, thirty-odd bytes, but a home can hold dozens of such files: inventories, settings, schedules and lists, and the savings add up across them. The tool reports the exact saving for each file, so you can see which ones are worth minifying and which ones are already small enough.

The common mistake

Homeowners sometimes edit the minified line by hand, to change one word or one number, and break the file by deleting a quote mark or adding a stray comma. The one-line version is hard to edit safely, because everything sits together with no spacing to guide the eye. Make the change in the pretty version instead, where each item sits on its own line, and then minify it again. The tool gives you a fresh, correct one-line result in a paste, and the pretty version stays as your master copy.

Frequently asked questions

How much does minifying save on a home inventory?

A kitchen inventory goes from 111 to 80 bytes, saving 31 bytes, or 27.9 percent. The room, the three items and the year are all unchanged.

How many bytes is the rupee sign in JSON?

Three bytes in UTF-8. The string “₹500” is 8 bytes in total: one byte for each quote, three for the rupee sign, and one each for the three digits.

How much does minifying save on a settings file?

A small settings file goes from 106 to 87 bytes, saving 19 bytes, or 17.9 percent.

Should I edit the minified line by hand?

No. Make the change in the pretty version, where each item sits on its own line, and then minify it again, so a deleted quote mark cannot break the file.

More guides on the JSON Minifier

Try it yourself

Try the JSON Minifier — free, in your browser.

Open the JSON Minifier