Indent messy or minified HTML so it's easy to read and edit.
Loading tool…
The formatter uses Prettier, the code formatter most web projects use, to indent your HTML consistently. CSS inside <style> and JavaScript inside <script> are formatted too. Prettier treats whitespace the way browsers do, so a space between inline tags like <b> and <i> is kept and the content of <pre> is left exactly as it was: the page looks the same, only the source gets tidier.
Make a one-line HTML file readable before editing it.
Tidy nested tables and inline styles in HTML emails.
Format HTML consistently so diffs show only real changes.
No. Prettier respects how browsers treat whitespace, so spaces between inline elements and the content of <pre> and <textarea> are kept. Only the source layout changes.
Yes. CSS inside <style> tags and JavaScript inside <script> tags are formatted with the same rules.
Prettier can format most real-world HTML. If the markup can't be parsed, for example an unclosed comment, you'll see the error and its line instead of a result.
Prettier 3, running entirely in your browser, with your choice of indentation and line width.
No. Everything runs in your browser; nothing you paste or upload is sent to our servers.