HTML Formatter
Format, minify, and validate HTML online for free, right in your browser.
Local browser processing
No sign-up required
Upload & download support
LanguageFor pages and template markup
HTMLinput.html
Indent
⌘⏎Quick format
InputEditable
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
OutputHTML valid16 lines · 272 B
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
!DOCTYPE html>
<html>
<head>
<title>Demo</title>
</head>
<body>
<!-- main content -->
<ul class="list">
<li class="item">One</li>
<li class="item">Two</li>
</ul>
<script>
const greet = (name) => console.log("Hi " + name);
</script>
</body>
</html>
UTF-8 · Indent: 2 spaces · Auto wrap: onLocal processing · Ready
How It WorksHTML
Overview
This HTML formatter turns minified or inconsistently indented HTML into clean, readable code with consistent indentation, or minifies it down to the smallest size. Content inside pre, textarea, script, and style tags, along with attribute values and inline code, is preserved exactly as-is and never gets broken. Everything runs locally in your browser; your data never leaves your device.
Use Cases
Clean up minified page source codeUnify a team's code indentation styleMinify HTML for production releaseCheck whether tags are properly closed
Steps
123
Paste or uploadSet optionsGet the result