HTML Formatter / Minifier

How to use

Prettifies HTML with clean, consistent indentation, or minifies it into a single compact line to shrink file size. Useful for tidying up scraped markup or shrinking a page before deploying it. Paste your HTML, choose Format or Minify, and copy the result.

DeveloperLocal only
Indent:
Input HTML
Output
Result will appear here...
When to use this
  • Prettifying markup scraped from another website to make it readable during review
  • Minifying a page's HTML before deployment to shave off file size
  • Cleaning up auto-generated markup from a page builder before hand-editing it
  • Standardizing indentation across HTML templates maintained by multiple developers

Free and private. Everything runs on your own device, with no account and no uploads.

Cleaning up markup scraped from another website, or shrinking a page's HTML before deployment, are two very different needs served by the same tool. This formatter prettifies HTML with consistent, configurable indentation for readability, or minifies it into a single compact block to reduce file size, giving developers a quick way to tidy or compress markup without a full build pipeline.

No, formatting only adjusts whitespace and indentation in the source code, it does not alter the DOM structure or how the page looks when rendered.

Minification typically strips unnecessary whitespace and can remove comments, which shrinks file size but also removes any inline notes for other developers.

Basic indentation is applied around these blocks, but the JavaScript or CSS content itself is not deeply reformatted, use the dedicated JS or CSS formatter for that.

No, it focuses on formatting rather than checking for invalid or deprecated HTML, use a dedicated validator if you need standards compliance checking.

Yes, everything runs in your browser with no data sent to a server.

How it works
  1. 1

    Paste your HTML

    Add the markup you want to format or minify.

  2. 2

    Set the indent size

    Choose your preferred indentation width for Format mode.

  3. 3

    Choose Format or Minify

    Pick whether you want readable output or a compact single-line result.

  4. 4

    Copy the result

    Copy the processed HTML into your project.

Pro tips
  • ·Formatting only touches whitespace and indentation, it will not fix invalid or deprecated markup, so pair it with a validator if standards compliance matters.
  • ·Use the dedicated JS or CSS formatter for the contents of <script> and <style> blocks, this tool only lightly indents around them.
  • ·Minifying strips comments along with whitespace, so keep an unminified copy if you rely on inline notes for other developers.