Messy input
<ul><li><a href="/home">Home</a></li><li><a href="/about">About</a></li></ul>The HTML Formatter takes compact or inconsistently indented markup and rewrites it with clean indentation that reflects the document tree. It places block elements on their own lines, indents nested children, and tidies attribute spacing so the structure of a page becomes immediately clear. Everything happens in your browser, so your markup, including any inline data or template fragments, is never uploaded anywhere.
HTML (HyperText Markup Language) is the structural foundation of every web page, using nested elements and attributes to describe content for browsers. Markup is frequently minified for production or generated by templates, leaving it as one long, unreadable line. Reformatting restores the visual hierarchy so you can quickly find an element, verify nesting, and spot unclosed tags. Well-formatted HTML also makes code review and accessibility audits considerably easier.
The main file is the entry point for each run.
Use the Input panel to pipe standard input to your program when it needs data.
Run sends your code to a fresh hosted runtime and streams the result into the output panel.
Your draft stays in this browser, and Share creates a separate snapshot link.
<ul><li><a href="/home">Home</a></li><li><a href="/about">About</a></li></ul><ul>
<li>
<a href="/home">Home</a>
</li>
<li>
<a href="/about">About</a>
</li>
</ul><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Page</title>
</head>
<body>
<h1>Hello</h1>
</body>
</html><form action="/submit" method="post"><label for="email">Email</label><input id="email" type="email" name="email" required><button type="submit">Send</button></form><form action="/submit" method="post">
<label for="email">Email</label>
<input id="email" type="email" name="email" required />
<button type="submit">Send</button>
</form><table>
<thead>
<tr>
<th>Name</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>Widget</td>
<td>$9.99</td>
</tr>
</tbody>
</table><header>
<nav>
<a href="/">Home</a>
</nav>
</header>
<main>
<article>
<h2>Title</h2>
<p>Body text.</p>
</article>
</main>
<footer>
<p>© 2026</p>
</footer><select name="size"><option value="s">Small</option><option value="m" selected>Medium</option><option value="l">Large</option></select><select name="size">
<option value="s">Small</option>
<option value="m" selected>Medium</option>
<option value="l">Large</option>
</select><figure>
<img src="chart.png" alt="Sales chart" />
<figcaption>Quarterly sales</figcaption>
</figure>The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.
Paste compact markup and it rewrites the HTML with indentation that mirrors the tree.
Block elements are placed on their own lines and nested children are indented.
Attribute spacing is tidied so the page structure is immediately clear.
Restores the visual hierarchy of minified or template-generated markup.
Makes it easy to verify nesting and spot unclosed tags.
Helps you quickly locate a specific element in a large document.
Everything happens in your browser, so markup is never uploaded anywhere.
Inline data or template fragments stay entirely on your machine.
Copy the formatted markup to paste back into your project.
Useful for accessibility audits and reviewing structural changes.
Output
Start typing to auto-process