Format or minify HTML markup with configurable indentation, attribute wrapping, and comment preservation.
HTML Formatter is a free online tool that adds line breaks and indentation to HTML markup, making it easy to read and edit. It is useful for minified HTML, CMS fragments, email templates, SSR output, landing pages, and widgets. The tool runs in your browser and does not send data to the server.
Choose a related tool for the next step.
Data passed between tools is kept only in the current browser session.
HTML Formatter adds line breaks and indentation to HTML markup for readability. The tool is useful for minified HTML, CMS fragments, email templates, SSR output, landing pages, widget HTML, and UI template snippets.
You can choose 2 or 4 space, or tab indentation, wrap long attribute lists onto new lines, preserve comments, and skip re-indenting the contents of pre, code, textarea, script, and style elements. The service formats markup but does not fix tag semantics, accessibility, SEO issues, or replace a W3C validator.
All processing is done locally in the browser. Your data is not sent to the server.