Instantly and automatically clean up your code with HTML Formatter


HTML Formatter can instantly format unstructured, messy code into an indented, cleaned-up logical structure. It can process a wide range of code types including HTML, ASP, PHP, Smarty templates, XML, and Coldfusion.

[UPDATE: since first writing this review this program is NO LONGER FREEWARE]

If you write code you already know how important it is to have a clean, organized layout. This can not only make your code more intuitively readable (by you or someone else), but can also have an esthetic, pleasing angle as well.

The problem, of course, is that formatting and cleaning up code can consume a lot of time; wouldn’t be simply perfect if there was a tool that could simply read your code, figure out its logical structure, and format and clean it up for you? HTML Formatter is precisely such a tool.

I’d previously written about GUI Tidy, a frontend for the very well known HTML Tidy. A quick comparison between the results obtained after running a snippet of messy code through that tool and through HTML Formatter showed the latter clearly superior. While GUI Tidy’s output had broken links and the occasional unformatted clutter strewn about, “HTML Formatter” re-structured the code almost perfectly. And although I only occasionally write code you do not have to be a programmer to see, at a glance, the improvement that this program can lend to messy code.

Here are more notes on this program:

  • How it works: you can drag and drop a single file, multiple files, or entire folders on the program icon for processing. HTML formatter will then save re-structured versions of your files with “_Indented” added to the file name. This program has no GUI (or user interface of any kind, for that matter).
  • Customizable: you can edit a config file in the HTML Formatter folder in order to manipulate some of the program settings (e.g. what part of the code and which tags gets processed).
  • Structure: indents code, supports nested divs/nested tables, adds missing tags, formats your code and gives it a logical structure.
  • Support: supports any file where HTML/XML type tags need formatting such as HTML, ASP, PHP, Smarty templates, XML. Also supports Coldfusion.
  • NotificationsTags: will let you know about tags closed out of order and their position. If the number of closing and opening tags don’t match it will still guess where to indent so the formatting looks good.
  • Portable: Nothing to install; just unzip and run whenever needed.
  • Free: recently became freeware, although you will need a serial number (found on the site).

Freewaregenius 5-Star Pick

The verdict: at what it does, HTML Formatter is one of the best out there, if not the best. A very useful tool which can save you a lot of time and which delivers great results. Spread the word!

[Update Apr 10th, 2008: this program has now become shareware; however, you can still download and use the last available freeware version at the bottom of this review]

Version Tested: 2.11

Compatibility: WinAll..
Go to the HTML Formatter page. To download the last freeware version (2.11) go here (approx 616K).