HTML formatter
Format HTML source while preserving whitespace-sensitive content.
Bookmark this page
Keep this page handy for next time.
- On a computer
- Press Ctrl + D, or Command + D on a Mac.
- On a phone or tablet
- Open your browser's menu or Share menu and look for Add Bookmark, Bookmark or Add to favourites.
A bookmark saves the page link. Save any tool results separately.
How to use this tool
- Format HTML source while preserving whitespace-sensitive content.
- Adjust the labelled settings, then run the tool. Copy the result or download it as a file.
Things to know
- Processing is local. Supplied code and network requests are never executed. Input and text settings are limited to 5 MiB combined; text settings alone are limited to 1 MiB.
- Compact mode removes comments and collapses ordinary text whitespace while preserving inline spaces and pre, textarea, script and style contents.
- Source: 2 MiB, 50,000 nodes, 128 nesting levels, 256 attributes per element and 100,000 total attributes. Formatting expansion is estimated before parsing. Compact output preserves whitespace-sensitive elements.
You might also need
More in web developmentJavaScript formatter and minifier
Format or minify JavaScript source without running the program.
CSS formatter and minifier
Format or minify CSS without executing it.
Content Security Policy builder
Build a policy from explicit directives and check common unsafe settings.
SQL formatter
Format SQL using the selected database dialect.
HTML to plain text
Extract readable text from HTML while retaining useful line breaks.
HTML link extractor
Extract links and their labels from pasted HTML.
HTML table extractor
Extract a selected HTML table into rows and CSV.
CSS selector tester
Find matching elements in pasted HTML without rendering the supplied page.
Responsive image markup builder
Generate picture and srcset markup from an image naming pattern.