All you have to do is copy-paste your code into the large text area and press the big Tidy button. The program will convert it to a nice code according to the cleaning options which are available on the right side of the screeen. Use the checkboxes and dropdown menus to set up the desired settings.
The taskbar below the composer lists some useful features. Load the demo script to experiment with this free online tool. This is recommended before tweaking the scripts for a live site. Adjust the character size, revert the document back to the previous state with the Undo button, start a fresh page or remove the comments with a click of a button.
The program is using JS Beautifier, a free and open-source program.