What are some of the most popular tools for automatically cleaning up HTML code to its cleanest and most best practices rendition?
The only one I know is the venerable HTMLtidy.
Please see this for examples of best practices.
Webmasters Stack Exchange is a question and answer site for pro webmasters. It only takes a minute to sign up.Sign up to join this community
Depends, there are several options and depending on your coding IDE. For example, Sublime Text has some really nice built-in coding cleaner and can be extended by a gazillion of plugins for probably every coding language out there.
Of course, there are several other cleaning tools out there, but honestly, I have yet to find one which brings clean results out of the box, since lots of coders out there don't quite follow the standards to the dot.
If you mean automatically cleaning up your own HTML code, Dreamweaver has commands to apply formatting and clean up XHTML code, along with a W3C validation check.
Speaking of which, that uses the WC3 Markup and Validation Service, which allows for validation of a URI, uploaded file, and copy/pasting HTML code. The WC3 HTML Tidy Service will also cleanup your HTML.
Komodo Edit IDE has a number of formatting options and extensions (add-ons) that format and cleanup HTML, JS, CSS...and numerous other languages.
Here's a comparison of HTML Parsers, with HTML Tidy likely being the most popular, and used by the online WC3 HTML Tidy Service.