Category: Developer tools
HTML Formatter
Indent and beautify HTML locally, without touching script or style content
Paste HTML to re-indent nested tags for readability. Content inside <script>, <style>, <textarea> and <pre> is left untouched so embedded code and formatting never break. Runs entirely in your browser.
Formatted.
<main>
<!-- LocalTools example -->
<h1>Offline browser tools</h1>
<p>
Everything runs
<b>on your device</b>
.
</p>
<ul>
<li>No upload</li>
<li>No account</li>
</ul>
</main>This is a lightweight indenter, not a validator — it will not fix mismatched or unclosed tags.
Everything on this page is processed in your browser. Nothing is uploaded.
What this tool does
An HTML formatter re-indents nested elements so a deeply nested page structure is easy to scan without a browser dev tools panel. This tool is a lightweight indenter, not a full parser: it recognizes tags, comments and the doctype, but it does not validate markup or repair mismatched tags.
How to use it
- Paste your HTML into the input box, or load the example.
- Choose 2 or 4 space indentation.
- Copy the formatted output back into your project.
Privacy
This tool runs entirely in your browser. Your input is never uploaded, stored or shared — closing the tab removes it.
Frequently asked questions
- Is my HTML uploaded anywhere?
- No. Formatting happens in JavaScript running in the page, so your markup never leaves your device.
- Does it touch the content inside <script> or <style> tags?
- No. Embedded JavaScript and CSS are copied through exactly as written, since reflowing them could change meaning.
- Will it fix broken or mismatched HTML?
- No. It only re-indents based on the tags it finds; it does not validate or repair invalid markup.