Toffeekit
  • Home
  • All tools513
  • Recent
  • Favorites
Categories
  • Images51
  • Video21
  • PDF33
  • AI24
  • Data21
  • SEO12
  • Developer32
  • Text27
  • Design18
  • Files13
  • Utilities5
  • Productivity17
  • Finance26
  • Math39
  • Education19
  • Date & Time29
  • Converters43
  • Fun & Random24
  • SaaS13
  • Business17
  • Social11
  • Media5
  • Security13
Buy me a coffee
ToffeekitDeveloperHTML Formatter

HTML Formatter

Beautify or minify HTML, including inline CSS and JavaScript. Runs entirely in your browser, so nothing is uploaded.

Help
Runs locally Instant, no sign-up Works offline
Use cases

One click to the right settings

Beautify HTML

Indent a minified page so the structure is easy to follow.

Minify HTML

Strip comments and spare whitespace without breaking inline text.

How it works

How to use HTML Formatter

  1. 01Paste HTML into the input, or click Open to load an .html file.
  2. 02Choose Beautify or Minify at the top.
  3. 03For Beautify, set Indent, Wrap lines at, Attributes and Indent inside <html>.
  4. 04Copy or Save the result. The status line shows how much smaller minified HTML is.
Questions

HTML Formatter FAQ

6 answers to what people ask most about the HTML Formatter.

Does it format CSS and JavaScript inside the page?

Yes. Code inside <style> and <script> tags is beautified with the same indent settings.

Will minifying break my page?

It is deliberately cautious. Whitespace is collapsed to one space and only removed next to block tags like <div> and <p>, so spaces between inline words and links stay. <pre> and <textarea> content is never changed.

Are IE conditional comments kept when minifying?

Yes. Comments starting with <!--[if are kept because some email clients still read them. Other comments are removed unless you turn on Keep comments.

What do the Attributes options mean?

Inline keeps attributes on the tag's line. One per line puts each attribute on its own line when a tag has several, and Aligned lines them up under the first attribute.

Does it fix broken HTML?

No. It re-indents what you give it but doesn't add missing closing tags or validate the markup.

Is HTML Formatter free and private?

Yes. It's free with no sign-up or limits, and it runs entirely in your browser, so what you type or paste never leaves your device. It works on phones and computers alike.

Something not working? Tell us and we'll fix it.

Report an issue
More tools
JSON Formatter

Format, minify and validate JSON with clear errors.

Developer
Base64 Encode / Decode

Encode text to Base64 or decode it back, UTF-8 safe.

Developer
URL Encode / Decode

Percent-encode query values or whole URLs.

Developer
HTML Entities

Escape < > & and quotes, or decode entities.

Developer
Something off with HTML Formatter? Report an issue or ask for a feature.Send feedback
© 2026 Toffeekit/Runs locally · No uploads · Free
AboutContactFeedbackPrivacyTermsCookiesSettingsllms.txt