Format HTML
Beautify messy or minified HTML with clean indentation, or minify it, in a code editor with syntax highlighting. Free, private, runs in your browser.
- Files never leave your device
- Free, no sign-up
- No watermark
About HTML Formatter
Make tangled or minified HTML readable again. Paste markup into the code editor, choose beautify or minify and your indentation, and get clean, consistently nested HTML with syntax highlighting, ready to copy or download. It is ideal for inspecting email templates, CMS output and scraped pages. Formatting runs locally with js-beautify.
How to use HTML Formatter
- 1
Paste your HTML into the editor.
- 2
Choose beautify or minify and set indentation.
- 3
Review the output.
- 4
Copy or download it.
Why use this tool
- Beautify and minify modes.
- Syntax-highlighted code editor.
- Adjustable indentation.
- Handles inline CSS and scripts.
- Copy or download the result.
- Handy for reading CMS output and scraped markup.
Frequently asked questions
No. Beautifying only changes whitespace between tags, which browsers ignore in most contexts.
Smaller HTML downloads faster, which helps page speed.
It improves layout but does not repair missing tags. Use a validator for errors.
Yes, including table-based layouts.
No. It is formatted in your browser.
No. Everything is processed in your browser tab. Nothing you type or paste is sent to CodeMites or any other server.
Yes. There is no account, no watermark and no usage limit. The tool runs in your own browser, so there is no server cost to charge you for.
Yes. It runs in any modern browser on Android and iOS as well as on Windows, macOS and Linux, with nothing to install.
Yes, once the page has loaded. Everything runs in your browser, so you can keep working on a train or plane without a connection.
Two spaces is the most common choice for HTML. Pick whatever matches your project’s editor settings or Prettier configuration.
Related tools
All Developer tools →- CSS FormatterBeautify messy or minified CSS with clean indentation, or minify it for production, in a code editor with syntax highlighting.
- HTML Entity EncoderEncode special characters to HTML entities or decode entities back to text, with named, decimal or hex formats and a reference table.
- Markdown PreviewWrite Markdown and see rendered HTML live, with tables, code blocks and task lists.
- Regex TesterTest regular expressions with live match highlighting, capture groups, flags and a quick-reference cheat sheet.
- Cron Expression BuilderBuild cron expressions with dropdowns, read them in plain English and preview the next run times.
- Chmod CalculatorSet Unix file permissions with checkboxes and get the octal value, symbolic notation and chmod command.