Beautify or minify HTML, including inline CSS and JavaScript. Runs entirely in your browser, so nothing is uploaded.
6 answers to what people ask most about the HTML Formatter.
Yes. Code inside <style> and <script> tags is beautified with the same indent settings.
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.
Yes. Comments starting with <!--[if are kept because some email clients still read them. Other comments are removed unless you turn on Keep comments.
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.
No. It re-indents what you give it but doesn't add missing closing tags or validate the markup.
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