Beautify or minify HTML.
The HTML Formatter re-indents messy or minified HTML so the structure is readable, or squeezes readable HTML down by removing comments and indentation. Pick 2 spaces, 4 spaces or a tab, and the output updates as you type.
HTML ignores most whitespace between tags, so the same page can be written on one line or spread across hundreds of indented lines and the browser will build the same document tree. Beautifying adds line breaks and indentation that reflect nesting, which makes missing closing tags, wrongly nested elements and deeply buried attributes much easier to spot. Minifying goes the other way and removes characters that do not change how the page renders, such as comments and indentation, to reduce the size of what is sent over the network. Whitespace is not always free to remove, though. Inside pre and textarea it is part of the content, and between inline elements a single space can separate two words. This tool beautifies with the js-beautify library, and its minifier is deliberately conservative for that reason.
It is designed not to. It removes comments and indentation, collapses whitespace runs, and trims spaces around block-level tags. Content inside pre, textarea, script and style is untouched. Still, test the result on pages that depend on whitespace between inline elements.
No. style and script blocks are preserved exactly as written. Use the JavaScript Formatter for script content.
js-beautify, the same engine used by many editors. This tool sets it to not wrap long lines and to keep at most one blank line.
No. It formats the text it is given and does not validate or repair markup. Unclosed tags remain unclosed.
No. The formatting runs in the page and your input is not sent to a server.
Yes, 2,000,000 characters per run.