HTML Formatter and Minifier

Beautify and minify HTML.

No external services
Built by Derar Sattouf

HTML Formatter

Input

Output

What is the HTML Formatter?

The HTML Formatter tidies markup using Prettier, indenting nested elements and wrapping long attributes so templates are easy to read and review. It can also minify HTML for production. It is useful for cleaning markup copied from a CMS, an email builder or a minified page, without uploading the code.

How to use it

  1. Paste your HTML.
  2. Choose Beautify or Minify.
  3. Copy the result.

Features

  • Prettier-powered formatting
  • HTML minification
  • Consistent indentation
  • Runs locally

Frequently asked questions

Is my code sent to a server?

No. The tool runs entirely in your browser with JavaScript. Your code never leaves your device, nothing is logged, and it keeps working offline once the page has loaded.

Will formatting change how my page looks?

Formatting only changes whitespace in the source. In rare cases whitespace between inline elements affects spacing, so review inline-heavy markup after formatting.

Related tools

See all 26 developer tools

Last updated: October 2026 · Built by Derar Sattouf