All tools Developer Tools

HTML Formatter

Indent HTML so its structure is clear.

Your details

Paste your HTML here.

100 of 100 free uses left today

Your result will appear here

Fill in the details on the left and press the button. You will see the answer right here, without the page reloading.

About this tool

Paste HTML to get it indented: block elements on their own lines, inline elements kept in the text, <pre> and comments untouched, and the contents of <style> and <script> formatted too. Only whitespace between tags changes; markup is never fixed or rewritten. Your text is processed for this request only and is never stored.

Frequently asked questions

What does formatting do?

Adds indentation so the structure of the markup is clear. It does not change how the page looks.

Can it fix broken HTML?

It formats what you give it. Unclosed tags still need fixing by you.

Does it keep inline scripts and styles?

Yes, they stay in place.

Guides and tutorials

Related tools