Australian Website Design Measured figures. Named sources.
Menu Close

Minification

What is minification in web design? Stripping unnecessary characters from a site's code to make files smaller, and why it changes nothing a visitor sees.

Glossary

Minification removes unnecessary characters — extra spaces, line breaks, developer comments — from a website’s CSS and JavaScript files, producing a smaller file a browser downloads and runs faster. It does not change what the code does.

Why minification is invisible to a visitor

Minified code, the output of minification, runs identically to its unminified version; the removed characters exist only to make the code easier for a person to read, not for a browser to execute. A minified file looks close to unreadable to a human glancing at it, which is expected and not a sign of anything being broken. Visible page content, including anchor text (the clickable words of a hyperlink), stays untouched because minification works on CSS and JavaScript files only.

Why it is a genuine, if small, performance contributor

Minification cuts real bytes: every kilobyte a browser downloads before a page becomes usable adds to load time, and CSS and JavaScript can be a meaningful share of a page’s weight. That share grows on a site using a page builder or a large number of plugins that each add their own script and style files. Minification is one of the small, cumulative performance techniques — alongside lazy loading, concatenation (combining files into one to cut the number of separate requests), serving files through a CDN, image compression and reducing unnecessary scripts — that together determine how a page performs, rather than a single fix on its own.

What to check to confirm minification is happening

Modern build tools and platforms minify CSS and JavaScript automatically when publishing a site, so the check is to confirm it is happening rather than assume it. Viewing a page’s source code shows either dense, minified files or clearly formatted, unminified code, and the difference is worth checking on an older or custom-built site in particular. The same source view shows whether the page head declares a favicon, the small icon representing the site in a browser tab.

What to do next

For where this kind of technical performance work — minification and the related techniques above — sits in a project, the development half of a build covers where it is scoped. For the other terms in a web quote, see a glossary of web terms.