HTML Formatter
Turn minified or messy HTML into neatly indented code you can read and edit.
Runs in your browser · No uploads
Your browser is too old to run this tool. Please update it, or use a current version of Chrome, Edge, Firefox or Safari.
- Nothing leaves your device
- No server-imposed size limits
- No sign-up, no watermark
- Free
How to format HTML
- Paste your HTML, open a file, or try the example.
- Pick the indentation and where long lines wrap.
- Copy or download the tidy HTML.
Good to know
- Only spacing and line breaks change. The content inside <pre> and <textarea> is kept exactly.
- Inline <script> and <style> blocks are formatted too.
- Formatting doesn't check for mistakes such as unclosed tags; the result follows the structure the code has.
- Formatting is done by js-beautify, a widely used open-source formatter.
Frequently asked questions
Will formatting change how my page looks?
Usually not. In rare cases, whitespace between inline elements (such as two links side by side) can add or remove a small gap.
Is my code uploaded?
No. Everything happens in your browser, and the page is blocked from uploading anything.
Related tools
-
Format or minify CSS
Beautify CSS for reading, or minify it for a smaller file. -
Format JavaScript
Beautify minified or messy JavaScript with consistent indentation. -
Encode HTML entities
Escape <, >, & and quotes for HTML, and optionally every non-ASCII character. -
Format XML
Pretty-print, minify and check XML, with the exact line of any error.