How to use
- Paste your HTML.
- Choose HTML or Vue, indentation and line width.
- Click Format, or press Ctrl+Enter (⌘+Enter on Mac).
- Copy the formatted markup.
Options explained
- Line width
- Elements with many attributes are split with one attribute per line when they would exceed this width.
- Vue
- Formats .vue single-file components — the template, script and style blocks.
Examples
Email template. Paste a one-line HTML email to see its table structure indented.
Copied page source. Format a page’s source to find the section you need.
Frequently asked questions
Why is some text kept on one line?
In HTML, adding whitespace between inline elements can change how the page looks. The formatter respects the CSS display of each element and does not add spaces that would appear on screen.
Does it fix invalid HTML?
It adds closing tags that HTML lets you leave out, such as </li> and </p>. Tags closed in the wrong order cause an error with the line and column, so you can fix them at the source.
Is my code uploaded?
No. Everything runs in your browser.
Privacy
This tool runs entirely in your browser. Your files and text are processed on your device and are never uploaded to our servers.