RelicRELIC

HTML Formatter

Beautify and indent messy HTML so the structure is clear, or minify it to a single line. Runs in your browser, nothing uploaded.

Runs entirely in your browser. Nothing you type is uploaded.
indent
Input
Output
Formatted HTML appears here…

Beautify or minify, your call

Paste raw HTML and Beautify indents it by walking each tag, opening a new level when an element opens and closing it back out, so nesting reads cleanly. Void elements like br, img and meta do not add a level, and short elements that just wrap a bit of text stay on one line. Flip to Minify to collapse the whitespace between tags and drop comments for the smallest output. Everything runs in your browser, so your markup never leaves your device.

For the markup you reach for again

That snippet, that component, that one email template you keep rebuilding. Relic keeps an end-to-end encrypted, searchable memory of everything you copy, on every device, for as long as you want. The formatter is free, and the HTML you just cleaned up is one search away the next time you need it.

Frequently asked questions

How do I format HTML?

Paste messy HTML into the input and Beautify indents it by walking each tag, opening a new level when an element opens and closing it back out so the structure reads cleanly. Choose a 2 or 4 space indent, or hit Minify to collapse the whitespace between tags into one line. It updates as you type, right in the browser.

How does it handle void and inline elements?

Void elements like br, img, hr, input, link and meta never open a new indent level, since they have no closing tag. Inline elements such as a, strong, em, span and code are kept tight to their text rather than being pushed onto their own line, so a short link inside a sentence stays readable instead of getting exploded across three lines.

What happens to my script, style, and pre blocks?

Their contents are pulled out and protected before formatting, then restored verbatim afterward, so the formatter never re-indents or collapses the whitespace inside a pre, textarea, script or style block. HTML comments are protected the same way, and in Minify mode comments are dropped while everything else comes back untouched.

What is the difference between beautifying and minifying HTML?

Beautifying adds indentation and line breaks so a human can read the nesting, which is what you want while editing or reviewing. Minifying strips the whitespace between tags and removes comments to shrink the byte size for transport, which is what you want for production. This tool does both from the same paste, so you can flip between them.

Does my HTML get sent to a server?

No. The formatter runs completely in your browser and nothing is uploaded, so your markup stays on your device. That is handy when the snippet is an internal email template or a component you are not ready to share.

More free tools
JSON Formatter
json formatter
Base64 Encode / Decode
base64 decode
Diff Checker
diff checker
URL Encode / Decode
url decoder
UUID Generator
uuid generator
Epoch Converter
epoch converter
All tools