Why minified HTML is hard to read
Markup that arrives from a build pipeline, a CMS export or a “view source” on a production page is usually stripped of every line break. The structure is intact but invisible — finding the element you care about means scanning a single enormous line.
Beautifying restores the indentation so nesting is visible again. This uses Prettier, the same formatter most JavaScript projects already run, so the output matches what your editor would produce.
Whitespace is not always insignificant
HTML collapses runs of whitespace, but it does not remove it entirely. The space between </span> <span> renders as a real gap, and content inside <pre> preserves every character exactly. A formatter that indents naively can insert or remove visible spacing, which is why this one considers each element's display type before reflowing it.
For the styles and scripts that go with your markup, see the CSS minifier and JavaScript formatter. To display markup as text on a page, escape it with the HTML entity encoder.