About HTML formatter
Paste HTML, even a whole page that has been minified onto one line, and get it back indented so you can see how the elements are nested. Styles in <style> tags and scripts in <script> tags are formatted too.
Prettier is careful with whitespace: it will not add spaces inside text in a way that changes how the page looks.
How to use it
- Paste your HTML or open an .html file.
- Set the indent and line width.
- Press Format, then copy or download the result.
Why some lines stay long
Inline elements such as links and bold text sit inside sentences, and a line break there would add a visible space. Prettier keeps them together, so a paragraph may stay on one line even when it is long.
Questions
Will it fix broken HTML?
It formats HTML that a browser can understand. Badly broken markup, such as a tag that is never closed, is reported as an error so you can fix it.
Is my HTML private?
Everything happens inside your browser. Your file is never uploaded to a server, so it stays private and the tool keeps working even on a slow connection.