Dev Utilities / Tool 35 / FREE TO USE

HTML/CSS/JS Minifier & Beautifier

Minify or beautify HTML, CSS and JavaScript locally. Compare actual UTF-8 byte counts and inspect formatted output without executing the code.

THE WORKBENCH

Make the source easier to use.

IN YOUR BROWSER / PRIVATE INPUT
YOUR PRIVATE WORKSPACE

Give the code a useful shape.

Your input is processed in your browser. Nothing is sent to a conversion API.

Code language
Code operation

01 / FROM INPUT TO ACTION

How to use the
HTML/CSS/JS Minifier & Beautifier

  1. 01

    Choose the language

    Paste source code and select HTML, CSS or JavaScript. Do not paste an entire mixed project into one language parser.

  2. 02

    Pick the operation

    Minify for compact output or Beautify for readable formatting. JavaScript compression is optional; identifier mangling is disabled.

  3. 03

    Review and test

    Inspect the output and measured byte change. Save a new file and run the application’s own tests before replacing production code.

Each language uses its own parser

The code is parsed and serialized, not executed. A syntax error is reported rather than presented as a successful result. HTML parsers can repair malformed markup, so HTML output still needs a visual and structural review.

LanguageMinificationBeautification
JavaScriptTerser; optional compression, no name manglingPrettier with the Babel parser.
CSSCSS-tree parse and compact serializationPrettier CSS formatting.
HTMLParse5 with conservative whitespace/comment handlingPrettier HTML formatting; embedded code left unchanged.

Remove presentation whitespace from a small function

Whitespace removal can make a file smaller without renaming variables. Compression can perform additional JavaScript transformations, so leave it off until you are ready to test the resulting behavior. ES module parsing is an explicit option for module source.

THE STARTING POINT
function add(a, b) {
  return a + b;
}
THE RESULT / NEXT STEP
function add(a,b){return a+b}
Exact punctuation may vary with the selected engine and options; the exported code is the actual result.

Byte reduction is not a Core Web Vitals score

Before and after counts use UTF-8 bytes, which can differ from JavaScript character counts. Beautification normally increases size. Minification may make little difference to already compact code, and compressed transfer size is a separate measurement.

A smaller file does not prove faster rendering or execution. Network compression, caching, code splitting, parse time and application behavior all matter. This tool makes a concrete source transformation; it does not invent a performance grade or replace an application build pipeline.

Avoid fragile production edits

01

Keep source maps and originals elsewhere

This utility does not create an integrated deployment or source-map pipeline. Preserve the readable source.

02

Watch whitespace-sensitive HTML

Preformatted tags are preserved, but CSS can make whitespace significant on other elements. Test the rendered page.

03

Check licenses and embedded code

Important comments are retained where supported, but review notice requirements and mixed-language sections before shipping.

THE QUESTIONS THAT COME NEXT

HTML/CSS/JS Minifier & Beautifier:
questions, answered.

Does the code minifier run pasted JavaScript?

No. Terser and the formatters parse source without executing it. The output still needs your application tests before use.

Why does beautification make my file larger?

It adds indentation and line breaks for readability. Use minification for delivery size and beautification for review or debugging.

Does this tool rename JavaScript variables?

No. Identifier mangling is disabled. Optional compression can still transform expressions and control flow, so test compressed output.

Can HTML minification change whitespace-dependent layouts?

Yes. HTML whitespace can be significant through CSS or document context. Preformatted tags are preserved, but a rendered review remains necessary.

FURTHER READING

The calculations and checks above describe this tool's implementation. Use these primary references for the underlying formats and publishing guidance.

Prettier formatting ↗ (opens in a new tab)Terser options ↗ (opens in a new tab)
A USEFUL NEXT STEP

Keep the
work moving.

34

Text Diff Checker

Review the concrete change before replacing source.

↗
32

JSON/CSV/XML Formatter & Converter

Format structured data rather than treating JSON as JavaScript.

↗
37

Hash Generator

Record a digest of a reviewed build artifact.

↗
YOUR NEXT MOVE

Make the source easier to use.

Use the controls above, inspect the actual result and keep the source until you are ready to use your new copy.

Use the HTML/CSS/JS Minifier & Beautifier↑
Explore all 41 free tools ↗