tidy-html5

Validate, correct, and pretty-print HTML/XML documents

brewmacoslinux
Try with needOr install directly
Source

About

Granddaddy of HTML tools, with support for modern standards

Commands

tidy

Examples

Validate an HTML file and display errors$ tidy -e input.html
Clean and fix HTML file, save to output$ tidy -m input.html
Convert HTML to XHTML with pretty printing$ tidy -asxhtml -indent input.html