Input
Result
StarryTool Privacy Statement: At StarryTool, we highly value your privacy. All data processing on this page is performed on your device via client-side JavaScript, ensuring data security. We do not record or store any submitted or generated data. For more information about privacy practices on our website, please review our Privacy Policy.

Example

Input:
<html><head><title>Sample HTML</title></head><body><h1>Welcome to StarryTool</h1><p>This is a sample HTML document.</p></body></html>
Click the Format button to output:
<html>
<head>
    <title>Sample HTML</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.