CSS Formatter
Format and pretty-print CSS.
OpenTurn one-line or badly nested HTML into readable, indented markup while you type.
Type, paste, or drop an .html file onto the input panel.
Every tag lands on its own line with two spaces per nesting level.
Press Minify to strip comments and whitespace between tags instead.
Copy the output or download it as formatted.html.
You open a template export or a page source from a CMS and the whole document sits on one line. Before you can find the broken div or the stray inline style, you need structure you can scan. The HTML Formatter puts every tag on its own line and indents children by two spaces.
Paste markup or drop an .html file onto the input and the output updates on every keystroke. Each opening tag increases the indent, closing tags step back out, and void elements such as img, br, input and meta stay at the same level. Comments, the doctype and CDATA sections are kept. The Minify button does the reverse, stripping comments and the whitespace between tags, and Download saves the result as formatted.html.
One thing to watch: this is a token-based indenter, not a browser parser. Text inside script, style and pre blocks has its whitespace collapsed to single spaces, so an inline script with // comments can break after formatting. Format the surrounding markup and paste long scripts back in afterwards, or check the structure first with the HTML tag balance checker. When you are ready to ship, shrink the markup for production. More markup utilities live in the code tools collection.
The markup is reformatted by a small JavaScript routine running in the page, so templates containing internal URLs or customer data are never transmitted.
Keyboard shortcut
Answers for this tool. For site-wide help, open the FAQ hub.
Not at the moment. The formatter always uses two spaces per nesting level. If your project uses tabs, run a find and replace on leading spaces in your editor after copying.
Every text node is written on a separate line under its parent tag. Browsers treat that extra whitespace as a single space, so an inline element like b or a in the middle of a sentence can occasionally gain a visible gap. Check spacing around inline tags before you commit.
No. It indents what you give it. A missing closing tag shows up as indentation that never steps back out, which is often the quickest way to spot it. The HTML Validator names those problems explicitly.