Beautify minified markup
<main><h1>Hello</h1></main>
↓
<main>
<h1>Hello</h1>
</main>
Turn compressed HTML into properly indented code that is easier to review and edit.
Free browser tool
Beautify unreadable markup, create compact HTML, or remove comments, scripts, styles, and unwanted attributes. HTMLCleanr gives developers flexible cleanup controls with immediate formatted output.
Common uses
<main><h1>Hello</h1></main>
↓
<main>
<h1>Hello</h1>
</main>
Turn compressed HTML into properly indented code that is easier to review and edit.
<!-- note --> <p>Hi</p>
↓
<p>Hi</p>
Minify markup and remove comments to reduce unnecessary document size.
<p style="color:red">Hi</p>
↓
<p>Hi</p>
Remove scripts, styles, empty elements, or unwanted attributes from imported markup.
What it can do
Create readable, indented HTML or compact markup for production use.
Remove comments, scripts, styles, empty elements, and unwanted attributes.
Control indentation, formatting mode, and entity handling for the final markup.
Three simple steps
Add a full document or HTML fragment to the Input field.
Select a format mode and any elements or attributes to remove.
Run HTMLCleanr, review the markup, then copy or download it.
Helpful answers
Yes. Select the formatting mode that matches whether you need readable or compact output.
Yes. HTMLCleanr includes options for removing script and style elements from the supplied markup.
Yes. You can configure entity handling alongside indentation and cleanup options.