Free tool · HTML beautifier
Free HTML formatter
Paste HTML or drop an .html file to beautify it with a 2 or 4 space indent, or minify it. The page renders exactly as before. Copy the result, or publish it as a link.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Proposal: Website refresh for Acme</title>
<style>body{font-family:system-ui,sans-serif;margin:0;color:#1c1917}header{padding:32px;background:#1c1917;color:#fff}.tag{display:inline-block;padding:2px 8px;border-radius:999px;background:#fff7ed;color:#c2410c}main{padding:32px}table{border-collapse:collapse;width:100%}td{padding:8px;border-bottom:1px solid #e7e5e4}</style>
</head>
<body>
<header>
<h1>Website refresh for Acme</h1>
<p>Northwind Studio for Acme Ltd <span class="tag">Draft</span><span class="tag">v2</span></p>
</header>
<main>
<h2>Scope</h2>
<ul>
<li>New homepage and <strong>six</strong> landing pages</li>
<li>Design system in Figma</li>
</ul>
<h2>Price</h2>
<table>
<tr>
<td>Design</td>
<td>$2,400</td>
</tr>
<tr>
<td>Build</td>
<td>$2,400</td>
</tr>
</table>
<p>Questions? <a href="mailto:hello@northwind.example">Email us</a>.</p>
</main>
<!-- generated by Claude -->
<script>document.querySelector('h1').dataset.ready = '1';</script>
</body>
</html>
Published free with no signup, the page is live for 7 days; sign up free to keep it. A published page is public to anyone with the link and noindex. Phishing and pages built to collect other people’s passwords or card details are taken down.
How it works
Format HTML in three steps
Paste or drop HTML
Paste the code into the editor, or drop an .html file. Minified exports, one-line AI output and hand-written pages all work.
Format or minify
Beautify with a 2 or 4 space indent, one block per line, or minify to drop comments and the whitespace that never shows. The result updates as you type.
Copy, download, or publish
Copy the result, download it as an .html file, or publish the page as a link you can send, with the size before and after shown.
What it leaves alone
An HTML beautifier that does not change the page
Code blocks stay exact
Text inside <pre>, <textarea>, <script> and <style> is copied byte for byte, so code samples, form defaults, JavaScript and CSS come out exactly as they went in.
Spaces between words stay
A space between two links or bold words is part of the text, and a missing one is too. The formatter only moves line breaks where the browser ignores them, next to blocks like div, p and li.
Attributes stay as written
Classes, links, inline styles and data attributes keep their exact values and quotes. Only the gaps between attributes are tidied to single spaces.
The next step
Beautify or minify HTML, then send it as a link
Noindex by default
Published pages tell search engines to stay away, so a page you share won’t surface on Google the way most free hosts’ public pages can.
Password protection
On Solo and Team, lock confidential pages with an encrypted password we can’t read, enforced before the page ever loads.
View tracking
See when the page is opened. Solo and Team add unique viewers, country and time on page.
More free tools
Other viewers and converters
HTML viewer
Paste or upload a full HTML document and preview it instantly in a sandboxed frame, at desktop or phone width.
Open the HTML viewer →HTML to text
Strip the tags from any HTML and keep the readable text, with lists, tables and line breaks intact.
Convert HTML to text →HTML minifier
Minify HTML with options for comments, whitespace, inline CSS and attribute quotes, and see the bytes saved.
Open the HTML minifier →HTML formatter FAQ
Paste the HTML or drop an .html file into the formatter above. It is beautified as you type: one block element per line, nested elements indented by 2 or 4 spaces, inline text kept on its line. Copy the result or download it. It is free, needs no signup, and runs entirely in your browser.
Yes. HTML beautifier, HTML formatter and HTML pretty printer all name the same job: re-indent the markup so a person can read it. Minifying is the reverse, removing comments and the whitespace that does not display so the file is smaller. This tool does both, and shows the size before and after.
It should not. Content inside pre, textarea, script and style is kept byte for byte, attribute values are untouched, and a space between inline elements is never added or removed. Line breaks only move where the browser ignores whitespace, next to blocks such as div, p, li and table cells. The tool also reads the page’s own style tags and leaves elements alone that they set to preformatted or inline-block. It cannot see rules in external stylesheets, or scripts that walk text nodes, so check pages that rely on those.
No. Formatting and minifying run in JavaScript in this tab, and nothing you paste or drop is sent to a server or stored. It only leaves your device if you choose to publish it as a page.
Yes. Publish puts the page on its own link in a few seconds, free and without signup for 7 days, and kept when you sign up. The page is noindex by default and counts its views; Solo and Team add passwords and full view tracking.