⌕
Developer · free online tool

HTML Minifier.

Minify HTML while preserving inline scripts.

Your workspace◈ Processed on your device
Your result
Your result will appear here.

A little context.

Removes comments and collapses safe whitespace. Preserves preformatted text and does not minify embedded JavaScript or CSS. Output is shown as text and is never executed. Test the result before deploying it.

Try an example

<div> <span>Hello</span> </div> → compact HTML

How to use this tool

  1. Enter html in the workspace above.
  2. Select Run tool to process your input. Invalid values produce a message next to the form.
  3. Copy the result or download it as a file. Reset example restores the original input.

Keep a good thing going.

A few related tools for your next step.