lobsite! Sign in Sign up

Free · runs in your browser · no sign-up

HTML Formatter

Paste minified or messy HTML and get it back cleanly indented and readable, then copy it, download it or publish it. Free, in your browser.

Format your HTML

HTML minifier →
Formatted
Free, no account. It stays up for 6 hours, or for good once you keep it.

Next Minify it again for production: HTML Minifier → Publish your site ↓

How to use the HTML formatter

  1. Add your HTML

    Paste it, open an .html file, or start from the sample: a page squashed onto one line.

  2. Pick the indentation

    Choose 2 spaces, 4 spaces or tabs. The formatted HTML appears as you type.

  3. Copy, download or publish it

    Press Publish this page to put it online.

What the HTML formatter changes, and what it doesn't

Formatting only adds and removes whitespace between tags: each block element starts on its own line, indented by how deep it is. Text, attributes and the content of <pre> and <textarea> stay as they are, so the page looks the same before and after. Blank lines you left between sections are kept (up to two in a row), and <script> and <style> contents are indented too.

When to format HTML

  • Reading the source of a page someone else built, or a minified template.
  • Tidying HTML an AI assistant wrote before you edit it.
  • Making a diff readable: format both versions the same way first.

HTML formatter FAQ

Will formatting change how my page looks?

Not for block elements. Between inline elements, like two links side by side, any whitespace shows as one space, and the formatter keeps inline elements on the same line where they were next to each other.

Does it fix broken HTML?

No: it indents what's there. To see how a browser reads it, open it in the HTML Viewer.

Which formatter does it use?

js-beautify, a widely used open-source formatter, running in your browser.

Is my HTML uploaded?

No. Formatting runs in your browser. It's sent to Lobsite only if you press Publish this page.

Publish your HTML page

Drop the folder, or run one command. Free, and live in seconds.

All formatters and minifiers →