HTML格式化器
在浏览器中处理或呈现HTML格式化。
使用步骤
如何使用
- Paste HTML up to 200,000 characters into the editor.
- Choose pretty print or compact output and an indentation width.
- Format the markup, review the browser validation status, then copy or download the result.
Readable HTML structure
Pretty print places nested elements, comments, and doctype declarations on clear lines using your selected two, four, or six space indentation. Compact output removes formatting whitespace between tags for smaller snippets.
Browser parsing, local output
The page uses the browser HTML parser and serializer. Parsing, formatting, copying, and downloading happen locally in your browser; no HTML is sent to a server. The browser may repair malformed markup according to HTML parsing rules.
常见问题
你可能还想知道
Does this upload my HTML?
No. Your markup stays in the current browser session and is processed locally.
Can I format a complete HTML document?
Yes. Paste a fragment or a complete document including doctype, head, and body elements.
Will invalid HTML produce an error?
HTML is forgiving by design. The browser parses and repairs common markup mistakes, so the result reflects the browser DOM rather than an XML-style validation error.
Does compact mode remove meaningful text?
It removes whitespace between markup tokens while preserving text, comments, attributes, and document content.