HTML Formatter

Beautify markup with your preferred indentation and line wrapping, or minify HTML while preserving whitespace-sensitive code and preformatted blocks.

Gustavo, the stone gargoyle mascot, head and shoulders with a knowing grin

Formatting and minification happen locally in your browser.

Original: 0 bytes · Output: 0 bytes · 0% saved

Notes

Format mode offers 2-space, 4-space, or tab indentation, plus line-wrap and blank-line controls. Minify mode can remove ordinary comments while preserving important and conditional comments when selected.

Whitespace inside pre, code, textarea, script, and style blocks is preserved during minification.

Formatting and minification happen in this browser. HTML is not uploaded or saved in browser storage.

Frequently asked questions

Can I change HTML indentation and line wrapping?

Yes. Choose two spaces, four spaces, or tabs, and set a maximum line wrap of off, 80, or 120 characters.

Does HTML minification change code block whitespace?

No. Whitespace inside pre, code, textarea, script, and style blocks is preserved exactly.

Is my HTML uploaded?

No. Formatting and minification run locally in your browser; your markup is not uploaded or saved in browser storage.