HTML Formatter & Minifier
Beautify HTML with clean indentation or minify it to one compact line — pre and textarea preserved, inline JS/CSS re-indented or left alone. Free, no upload.
<div class="card"> <!-- greeting --> <h2>Hi</h2> <p>Welcome to <a href="/">MakerBox</a>.</p> </div>
🔒 Processed in your browser — nothing is uploaded. Beautify re-indents the JavaScript in <script> and the CSS in <style> unless you turn that off; <pre> and <textarea> are always left as they are, and minify preserves all four.
Beautify or minify
Paste HTML and switch between two modes. Beautify re-indents the markup so every tag and text node sits on its own line, making the document structure easy to read. Minify strips comments and collapses insignificant whitespace into a single compact line to shrink file size. The content of <pre> and <textarea> is preserved exactly in both modes, and minify preserves <script> and <style> too. Beautify also re-indents the JavaScript in <script> and the CSS in <style> unless you clear the Format inline JS/CSS checkbox, which changes their spacing and nothing else, and void elements like <br> and <img> are handled without adding stray nesting.
When to use each mode
Use beautify when you have received compressed or single-line HTML and want to read or edit it, or to tidy up markup before committing it. Use minify to reduce the size of a snippet for production or an email template where every byte counts. Because everything runs in your browser, you can paste proprietary markup without it ever being uploaded. Note that minification here is conservative — it focuses on whitespace and comments and never rewrites your tags or attributes.
Frequently asked questions
Does minifying break my inline scripts or styles?
No. Minify preserves the contents of <script>, <style>, <pre> and <textarea> verbatim. Beautify leaves pre and textarea alone too, but it does re-indent the JavaScript and CSS inside script and style tags unless you clear the Format inline JS/CSS checkbox — that changes their spacing only, not what the code does.
What does beautify do exactly?
It re-indents the HTML so each tag and text node is on its own line with consistent indentation, without changing which tags or attributes are present. You can choose 2 spaces, 4 spaces, or a tab for the indent.
Is my HTML uploaded anywhere?
No. Formatting and minifying run entirely in your browser with JavaScript. Nothing you paste is sent to a server or stored.