HTML Formatter and Beautifier
Paste minified or messy HTML to indent it cleanly. Each nested element is pushed one level deeper, void tags like img and br stay flat, and the contents of pre, script and style are left exactly as written.
How to format HTML
- Paste your HTML into the editor.
- Pick an indent size of 2 spaces, 4 spaces, or a tab.
- Copy the formatted markup or download it as an .html file.
Examples
Indent a nested list
<ul><li>One</li><li>Two</li></ul>
<ul> <li>One</li> <li>Two</li> </ul>
Frequently asked questions
Is my HTML sent to a server?
No. Formatting happens entirely in your browser, so your markup never leaves your device.
How does the indentation work?
Every element adds one level of indentation to its children. Void elements such as img, br, input and hr are self-closing, so they never indent the tags that follow them.
Will it break my <pre>, <script> or <style> blocks?
No. The contents of pre, script, style and textarea are whitespace-sensitive or non-HTML, so they are copied through verbatim and never reindented.
Does it minify HTML as well?
This tool beautifies and indents HTML for readability. It collapses extra whitespace between tags but does not strip markup. For the smallest output, use a dedicated minifier.
Can I change the indent character?
Yes. Choose 2 spaces, 4 spaces, or a tab. The same options are available through the API using the indent field.
Related tools
Markdown to HTML
Convert Markdown to clean HTML in your browser. Headings, bold, italic, links, images, lists, blockquotes and fenced code blocks, with text safely escaped.
JSON Formatter
Format, validate and minify JSON online. Pretty-print with custom indentation, sort keys and catch syntax errors. Runs in your browser.
.env to JSON
Convert a .env file to JSON, or JSON back to .env. Parses KEY=value lines, comments, quotes and export. Runs entirely in your browser.
Aspect Ratio Calculator
Calculate aspect ratios fast. Enter a ratio like 16:9 and one dimension to get the other, or enter width and height to simplify the ratio.
Base58 Encoder
Encode and decode Base58 online with the Bitcoin alphabet. Convert text to Base58 or back, UTF-8 safe, no confusing 0 O I l. Runs in your browser.
Base64 Decode
Decode Base64 to plain text online. Paste a Base64 or base64url string and get instant UTF-8 output. Free, fast and runs in your browser.