Formatting
HTML formatter indents a fragment so nested elements stop sharing one line. <div><p>Hi</p><ul><li>One</li><li>Two</li></ul></div> becomes a div, then a p, then a ul, then each li, at two spaces per level. Text nodes stay with their tags when the beautifier keeps them inline.
It is not the minifier and it is not the entity encoder. Comments stay unless you remove them elsewhere. < and & in text are not rewritten as entities. A page that both indents and escapes will change the document you meant only to read. If the fragment is already pretty and you want bytes removed, the minifier has a separate control for whether text whitespace outside pre is collapsed.
Paste HTML. Script and style contents are text as far as indentation is concerned; this page does not run them and does not pretty-print the CSS inside a style tag with the CSS formatter’s rules.
<div><p>Hi</p><ul><li>One</li><li>Two</li></ul></div>
<div>\n <p>Hi</p>\n <ul>\n <li>One</li>\n <li>Two</li>\n </ul>\n</div>
Indent only. Entities, comments and minified whitespace are separate jobs, and mixing them makes a diff unreadable.
No. Indentation does not escape text. The entity encoder does that, and it will also turn a period into ..
No. The minifier removes ordinary comments. This page keeps the document and changes its whitespace.
Two spaces. The same indent as the CSS formatter.
It indents the HTML. For the CSS itself, paste that sheet into the CSS formatter.