Minification
The process of removing unnecessary characters from code such as comments and whitespace to reduce file size without changing behaviour.
Definition
Minification is the process of removing characters from source code — including comments, whitespace and redundant declarations — that are not needed for the browser to run it. It reduces the size of HTML, CSS and JavaScript files without changing how they behave.
Minification typically strips developer comments, collapses whitespace such as tabs and spaces, and consolidates redundant code into more compact forms. It is usually automated as part of a build process, often by a bundler, so that developers keep readable source code while production assets are smaller. Minification is separate from, and complementary to, server compression such as gzip or Brotli — applying both yields a cumulative reduction in transferred bytes. Source maps are commonly generated alongside minified files to support debugging.
Examples
Build pipeline
A bundler minifies a site's JavaScript before deployment, reducing a 516-character snippet to around 204 characters by removing comments and whitespace.
Combined with compression
A team minifies its CSS and also enables Brotli on the server, so the file is both smaller and compressed in transit.
Sources
Related terms
- Page SpeedHow quickly a web page loads and becomes interactive, measured by metrics such as Largest Contentful Paint, Interaction to Next Paint, and Time to First Byte.
- Render-Blocking ResourcesResources — typically CSS and synchronous JavaScript — the browser must fetch and parse before it can paint the first frame of a page.
- Core Web VitalsA set of three Google metrics that measure real-world page experience: loading speed, interactivity and visual stability.
- LighthouseAn open-source automated tool from Google that audits a web page for performance, accessibility, SEO and other best practices.
- Largest Contentful PaintA Core Web Vitals metric measuring how long the largest visible content element on a page takes to render after loading begins.
- Time to First ByteA performance metric measuring the time between a request for a page and the first byte of the response arriving back at the browser.
Where QueryCatch uses this
Last updated: 16/05/2026