convertCASEpro

MODE

HTML Formatter, Minifier and Beautifier

Clean up markup, or squeeze it down for production.

INPUT
CHARS: 0WORDS: 0LINES: 0
OUTPUT
CHARS: 0WORDS: 0LINES: 0

How the HTML Formatter, Minifier and Beautifier works

Beautify mode parses the document and prints it with nested elements indented, long attribute lists wrapped and inline elements kept inline so that text does not gain stray spaces. Embedded style and script blocks are formatted with the matching language rules.

Minify mode removes comments, collapses whitespace between tags and keeps the content of pre, textarea, script and style elements untouched. Treat minify as a lightweight step, since a build pipeline can also compress CSS and JavaScript and rename identifiers.

When it is useful

  • •Reading the source of a page that was served minified.
  • •Reformatting email templates and CMS output for editing.
  • •Reducing the size of a static snippet.
  • •Spotting unclosed or misnested tags.

Frequently Asked Questions

Will formatting change how the page looks?

The formatter is whitespace aware for inline elements, so rendering should not change. If you rely on exact whitespace inside an element, check pre and inline blocks after formatting.

Can it fix broken HTML?

It parses HTML leniently like a browser does, so many errors are tolerated. It will not rewrite markup to be valid.

Does it convert HTML to Markdown?

Use the HTML to Markdown Converter for that.

Related tools

[ Browse all tools ]