HTML Formatter, Minifier & Viewer
Free HTML formatter: beautify messy HTML with clean indentation, minify it to reduce size, and preview the result safely in your browser.
FreeRuns in your browserNo sign-up
Mode
Preview runs in a sandbox with scripts disabled.
Advertisement
How to use the HTML Formatter, Minifier & Viewer
- Paste your HTML.
- Choose Beautify or Minify.
- Use Preview to see it rendered.
- Copy or download.
Beautify vs minify
Beautify puts each tag on its own line with nested indentation, so structure is easy to read and debug. Minify removes comments and extra whitespace between tags to reduce page size.
Details worth knowing
- Void elements such as
<br>and<img>do not increase the indent level. - Contents of
<script>,<style>,<pre>and<textarea>are left exactly as written. - Minifying can change how inline elements sit next to each other, since spaces between tags may matter visually. Check the preview.
The preview runs in a sandboxed frame with scripts turned off, so pasted code cannot run.
Frequently asked questions
How do I format HTML?
Paste it, choose Beautify and copy the neat result.
Does minify change how my page looks?
Usually not, but removed spaces between inline tags can affect spacing, so preview first.
Is the preview safe?
Yes. It runs sandboxed with scripts disabled.
Does it fix broken HTML?
It only reformats. It does not correct missing closing tags.