+ +

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.

+ +
Indent
<!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>
Before 1.0 KB · after 1.3 KB · 21% larger Runs in your browser. We don't store what you paste.
✓Your page live in seconds ✓An unlisted link you can send anyone ✓Claim it free to keep it live

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

An HTML formatter re-indents markup so you can read it: one block per line, each level nested under its parent. Paste HTML or drop a file into the formatter above and it is beautified as you type, entirely in your browser, with nothing uploaded to a server.
1

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.

2

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.

3

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

Whitespace in HTML is not always cosmetic. A careless beautifier adds a gap between two buttons or breaks the indentation of a code sample. This one changes line breaks only where the browser ignores them.

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

Clean code is easier to check before it goes out. Publish the page on its own URL, isolated from your account data, and free for 2 public pages, so you can see that it was opened.

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.

+ +

Send the page, not the source

Free for 2 public pages. Solo is $15/mo and adds custom domains, passwords, and full view tracking.