Skip to main content

What is minification?

Minification is the process of compressing code (typically JavaScript and CSS) by removing everything that does not affect the program's execution.

During minification, the process usually:

  • removes whitespace, line breaks, and tabs
  • shortens local variable names
  • removes comments
  • removes unused parts of the code
  • rewrites expressions in a shorter form where possible

The goal: reduce the file size so it loads faster in the browser and speeds up the site.

Important: minification does not change the code's behavior, it only affects size and delivery speed.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.