Tool to Format HTML Code

format, formatting, html, web-applications

Solution

I use http://jsbeautifier.org/ and it works really good with HTML and JavaScript, besides you can configure identation, braces and other things

In this case, the output for your code is:

<table>
    <tr>
        <td>Hello Wolrd</td>
    </tr>
</table>

There's also http://dirtymarkup.com/ which seems useful as well.

I found http://www.freeformatter.com/html-formatter.html which has various formatters and validators.

Also there's http://infohound.net/tidy/ which seems to generate all the valid HTML markup in case you need it.

Another one is http://www.cleanuphtml.com/cleanup.html and there's the general purpose http://prettydiff.com/

Problem

Is there a tool/web app that will automatically sort out an HTML file in to proper tab structure? For example, from this: ``` <table><tr><td>Hello Wolrd</td></tr></table> ``` to this: ``` <table> <tr> <td>Hellow World!</td> </tr> </table> ``` I work with a lot of other peoples code, and I can't stand bad organization in HTML.

Original source