HTML Formatter

Paste a template, open a local HTML file, or fetch a public page, then switch between readable formatting and compact minification. Indentation, attribute wrapping, line width, newlines, quotes, and raw-content handling are yours to set. The markup is processed in your browser, so nothing is uploaded.

11Minification switches
1–8Indent width in spaces
80–120Line-width guides, or off

Who This Is For

Review a template with a team

Normalize indentation and attribute wrapping so a pull request shows real changes instead of unrelated whitespace churn.

Clean up CMS output

Turn a dense block exported by a CMS or page builder into indented markup that is easier to review, diff, and edit.

Inspect third-party HTML

Paste a minified landing page or email template and add structure before tracing selectors, scripts, or hidden comments.

📱Works on All Devices
🌍Accessible Anywhere
💯100% Free

Perfect For

Readable markup in seconds

Indent a dense template and make its hierarchy visible without installing an editor extension or a build tool.

Markup stays in the browser

Both engines run client-side, so pasted HTML, uploaded files, and fetched pages are not sent to a server for processing.

Controls that match the job

Set indentation, wrapping, line width, newlines, quotes, and raw-content handling instead of accepting one fixed house style.

Minify without a build step

Strip comments, collapse whitespace, remove optional tags and safe quotes, and process inline CSS or JavaScript in one pass.

$

Three ways to start

Paste from the clipboard, open a local .html file, or fetch a public URL when the target allows browser access.

%%

Iterate without retyping

Send the output back to the input panel or turn on auto-update to compare formatting choices while you adjust the settings.

Format or minify HTML in the browser, with 13 formatting controls and 11 minification switches.

Frequently Asked Questions

01Is minification reversible?

No. A formatter can put indentation back, but it cannot restore comments, optional tags, attribute quotes, or the author's original line breaks. Keep the readable source in version control and minify only the build artifact.

02What is the difference between formatting and minifying HTML?

Formatting adds indentation and line breaks so people can read the markup. Minifying removes comments and unnecessary whitespace so the browser downloads fewer bytes. The first is for editing and review; the second is for the files you serve.

03Does the minifier remove HTML comments?

Yes, comments are removed by default. Turn on Preserve comments when comments carry build instructions or conditional markup you still need. Removing comments is one-way: the original text cannot be reconstructed from the minified file.

How It Works

1

Load the markup

Paste HTML into the input panel, upload a local .html or .htm file, or fetch a public page whose server allows cross-origin requests.

2

Choose format or minify

Formatting controls indentation, wrapping, line width, newlines, quotes, and raw blocks. Minification controls comments, whitespace collapse, optional tags, attributes, CSS, and JavaScript.

3

Review and export

Run the action, compare the output with the input, then copy it or download an .html file. Send result back puts the output into the input panel for another pass.

Why Use This Tool

✓

Attribute wrapping and line width

Keep attributes on one line or wrap them automatically, per attribute, aligned, or preserved, with 80, 100, or 120 character guides.

✓

Paste, upload, or fetch a page

Start from the textarea, a local .html or .htm file, a public http(s) URL, or the built-in sample, then copy or download the result.

✓

Indentation that fits the project

Choose one to eight spaces or tabs, and optionally indent the contents of head and body for a conventional document outline.