HTML Formatter
Beautify and indent messy HTML code.
Free
Runs in your browser
About this tool
HTML Formatter re-indents HTML so nested tags are easy to follow. Use it on minified pages, email templates or code copied from the browser inspector.
How to use HTML Formatter
- Paste your HTML.
- Choose indent size and line wrap.
- Press “Beautify”, then copy or download.
Questions people ask
Will formatting change how my page looks?
Normally no. Browsers ignore most whitespace between tags. Content inside <pre> and <textarea> is left as it is.
Does it format inline CSS and JavaScript?
Yes. Code inside <style> and <script> tags is indented with the same settings.
Does it fix broken HTML?
It does not repair missing closing tags. Unclosed tags may lead to odd indentation, which can help you spot them.
More developer tools
See all 24 →
CSS FormatterBeautify minified CSS into readable rules.
JavaScript FormatterBeautify minified JavaScript with clean indents.
HTML MinifierShrink HTML by removing comments and whitespace.
CSS MinifierCompress CSS by stripping comments and spaces.
JavaScript MinifierRemove comments and whitespace from JavaScript.
Cron Expression ExplainerExplain cron schedules in plain English with next runs.