Skip to content
Developer & CodeLocal · Stays on device

HTML Minifier

Shrink HTML safely: remove comments and collapse whitespace while leaving pre, textarea, script and style contents untouched.

Launch HTML Minifier
  • HTML
  • Free to use
  • No sign-up or watermark
html-minifierOn this device
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10

About this tool

The minifier is deliberately conservative. It removes comments (keeping Internet Explorer conditional comments if you want), collapses runs of whitespace to a single space, and removes whitespace between tags only where a block-level element makes it safe, so spacing between inline elements such as <b>a</b> <i>b</i> is preserved. The contents of <pre>, <textarea>, <script> and <style> are never touched.

Optionally, quotes can be removed from attribute values that don’t need them (off by default for compatibility). The size before and after is shown. It does not minify embedded CSS or JavaScript; use dedicated tools for those. Everything runs in your browser. Your data is never uploaded, logged or stored.

  1. Input

    Your code or text

    HTML

  2. Processing

    Processed in this browser

    Instant, in-browser. Nothing is uploaded.

  3. Output

    Your result

    Ready to download or copy

Local processing pipelineCustom conservative minifier

How to use it

  1. 1

    Paste your HTML.

  2. 2

    Choose which optimisations to apply.

  3. 3

    Check the savings, then copy or download the minified HTML.

Zero-upload architecture

How to use HTML Minifier for free, with no upload

Free, with no sign-up or watermark · Your files stay on your device

  1. 1

    Open HTML Minifier

    Launch the app and add your file. There is nothing to install and no account to create.

  2. 2

    Work through it

    Choose which optimisations to apply.

  3. 3

    Get your result

    Check the savings, then copy or download the minified HTML.

  • Local

    HTML Formatter

    Beautify HTML with configurable indentation, line wrapping and attribute layout, without ever rendering or running it.

    Open tool
  • Local

    SVG Optimizer

    Clean and minify SVG files by removing editor data, comments and excess precision.

    Open tool
  • Local

    JSON Minifier

    Remove whitespace from JSON to make it as compact as possible, and see how much space you save.

    Open tool
  • Local

    JavaScript Minifier

    Minify JavaScript with terser: compress, shorten local names and keep licence comments, with exact syntax errors and size savings.

    Open tool