tools.voiddo.com

htmlfmt · html formatter & beautifier

Beautify or minify HTML instantly in your browser. Indent control, line wrap, comment stripping. Supports HTML5 and XHTML. Zero server — your code never leaves your machine.

input html
auto-formats 300ms after you stop typing · ctrl+enter to format now
formatted output

comparing tools? htmlfmt vs htmlformatter.com →

frequently asked questions

Does htmlfmt send my HTML to a server?

No. htmlfmt runs entirely in your browser using the open-source js-beautify JavaScript library. Your code never leaves your machine. There is no server-side processing, no logging of your HTML content, and the tool works offline once the page has loaded.

What is the difference between beautify and minify?

Beautify (also called pretty-print or format) adds indentation and line breaks to make HTML human-readable — useful during development or code review. Minify removes all unnecessary whitespace, comments, and newlines to reduce file size — useful before deploying to production to improve page load time.

Does htmlfmt support HTML5 and XHTML?

Yes. htmlfmt uses js-beautify which handles both HTML5 and XHTML markup. For XHTML, self-closing tags like <br /> and <img /> are preserved correctly. Void elements (br, hr, img, input, link, meta) are handled automatically.

How does the line wrap length option work?

Setting a wrap length (e.g. 120 characters) tells the formatter to break long attribute lists across multiple lines so no single line exceeds that width. Set it to off to disable wrapping entirely. This is especially useful for templates with many attributes on a single element.

Can I minify HTML with inline CSS or JavaScript?

htmlfmt's minify mode collapses inter-element whitespace and removes HTML comments. Inline <style> and <script> blocks are preserved as-is. For deeper compression of inline CSS or JS, combine htmlfmt with a dedicated CSS or JS minifier after running the HTML minification pass.

power user?

use this daily? tools.voiddo Pro · $9 one-time

supports 66 free tools · Pro license via Paddle · one flat price, no subscription