Home / Developer / HTML Minifier & Formatter

HTML Minifier & Formatter

Minify HTML by removing comments and extra whitespace, or beautify it with clean indentation.

Free, no uploads, no sign-up. Runs 100% in your browser.

How HTML Minifier & Formatter works

Your code is processed in this tab with plain TypeScript. Nothing is uploaded. The HTML is parsed into a tree. Minifying drops comments and whitespace that does not show, while keeping spaces between inline elements. , and content is untouched and is minified as CSS. Beautifying puts block elements on their own lines.

Input: HTML, Text. Output: HTML.

How to use HTML Minifier & Formatter

  1. Paste HTML or open a file.
  2. Pick Minify or Beautify.
  3. Check the size saved.
  4. Copy or download the result.

Tips

  • Everything is computed locally. Safe for tokens, keys and private data.
  • Use Ctrl/⌘ + K to jump between developer tools quickly.

HTML Minifier & Formatter FAQ

Are my files uploaded?
No. This tool runs entirely in your browser tab. Files are read from your disk into memory and the result is generated locally.
Is it free? Are there limits or watermarks?
Free. There are no file-size caps, daily quotas, accounts or watermarks.
Does it work offline?
Yes, once the page (and any engine it needs) has loaded, it keeps working without a connection thanks to the service worker cache.

Related tools

  • CSS Minifier & Formatter: Minify CSS to save bytes or beautify it with one declaration per line, keeping strings and calc() intact.
  • HTML Entities: Escape and unescape HTML entities.
  • HTML to Markdown: Convert HTML or rich text pasted from web pages, Word or Docs into clean Markdown.
  • JSON Formatter: Prettify, validate, minify and explore JSON as a tree.

ToolTaffy runs in your browser. Turn on JavaScript to use the tools.