HTML formatter
Indent bounded static HTML locally without rendering it or executing scripts.
How it works & useful details
Static markup, kept inert
Use this for static HTML tags, attributes, comments, and a doctype. The workspace shows markup as text only; it never renders tags or follows resources.
Tag spelling and attribute text are copied intact while nesting receives indentation. Script and style blocks are refused rather than being guessed as ordinary markup, and malformed/mismatched tags receive a local error.
Private, bounded text processing
Code and markup stay as inert text in this browser. These tools do not execute JavaScript, render HTML, load URLs, install packages, contact registries, or save what you paste.
Regex patterns are limited to 500 characters and test text to 20,000 characters. Formatters and package inspection accept up to 100,000 characters; exports are capped at 200,000 characters.
About this tool
HTML formatter indents static HTML for readability without rendering it or running any script it contains. It is useful for tidying markup copied from an email, a template, or a view-source dump before reviewing changes.
The markup is handled strictly as text: no element is inserted into the page, no resource is loaded, and no inline script is executed. You can paste markup from untrusted sources without it running in your browser.
How to use it
- Paste the HTML you want to indent.
- Run the formatter and inspect the nested output.
- Check any warnings about content the formatter left untouched.
- Copy the formatted markup or download it as a file.
Worked example
<main><h1>Toolbox</h1><p data-local="true">Format static markup.</p></main>becomes
<main>
<h1>
Toolbox
</h1>
<p data-local="true">
Format static markup.
</p>
</main>Every element and text node goes on its own line, indented by nesting depth, which makes the document structure obvious. Tag names and attribute values are copied exactly as written.
Limits to know
- Inline content is split onto separate lines too. In <p>Hello <a href="#">world</a>!</p>, the added line breaks can add visible spaces around the link when the output is rendered. Use the result for reading and reviewing, and keep the original markup for publishing.
- Script and style blocks are refused, because their contents follow JavaScript and CSS rules, not HTML rules.
- Every non-void element needs an explicit closing tag. HTML allows </li> and </p> to be omitted, but the formatter reports a mismatch instead of guessing where the element ends.
- Void elements such as <br>, <img>, and <input> need no closing tag and are handled.
Markup is never rendered or executed, which makes the tool safe for inspecting HTML from emails or unknown sources.
Frequently asked questions
Will the pasted HTML be rendered?
No. It stays inert text in the workspace; the page never injects or displays it as markup.
How are inline scripts and styles handled?
Their text is preserved and indented like any other content, but nothing inside them is evaluated.
What is the size limit?
Up to 100,000 characters, with formatted exports capped at 200,000 characters.
Can it fix broken HTML?
No. It formats well-formed markup and reports the first mismatched or unclosed tag it finds. That makes it a quick check for broken nesting too.
