How to Use the HTML Formatter: Steps and a Worked Example

By 1 min read

Put each HTML tag on its own line to make minified markup readable. This guide shows what to enter, a worked example, and the limits to keep in mind. The HTML Formatter tool is free, needs no account and runs in your browser.

What you need

  • HTML

Step by step

  1. Open the HTML Formatter tool.
  2. Fill in HTML.
  3. Read the result, which updates as soon as the inputs change.

Worked example

the tool returns:

<div>
  <h1>Title</h1>
  <p>Hello <b>world</b>
  </p>
  <ul>
    <li>One</li>
    <li>Two</li>
  </ul>

How it works

Paste HTML. Each tag starts a new line and nested tags are indented by two spaces. Inline tags inside text stay on the same line.

Things to keep in mind

Check your inputs, units and any local rules before you rely on the result.

If this is not quite what you need, try JSON Formatter, CSS Formatter or HTML Entity Decoder.

More from the blog