Example
Input:
<html><head><title>Sample HTML</title></head><body><h1>Welcome to Sample HTML</h1><p>This is a sample HTML document.</p></body></html>
Click the Format button to output:
<html>
<head>
<title>StarryTool</title>
</head>
<body>
<h1>Welcome to StarryTool</h1>
<p>This is a sample HTML document.</p>
</body>
</html>
About the Online HTML Formatter
The Online HTML Formatter helps you turn messy or compact HTML code into a cleaner, easier-to-read format. Paste your HTML, choose the indent size, and format it with clear line breaks and consistent spacing.
• Features
HTML Formatting: Adds readable indentation and line breaks to make HTML structure easier to follow.
Adjustable Indentation: Choose the number of spaces used for indentation to match your preferred coding style.
Readable Output: Makes nested tags, attributes, and text content easier to review, copy, and edit.
Simple Scope: This tool formats HTML for readability. It is not a validator, sanitizer, or automatic HTML repair tool, so review the code separately when correctness or security matters.