HTML Formatter
Make HTML readable with consistent indentation, or compress it by removing extra whitespace and comments. Everything runs in your browser. Your files and text are not uploaded to our servers.
Use the tool
Loading the tool...
How to use it
- Paste your HTML.
- Choose the indentation.
- Select Format to beautify or Minify to compress.
- Copy the result.
Tips for best results
- Contents of
<pre>,<textarea>,<script>and<style>are kept as written. - This is a formatter, not a validator. It will not fix unclosed tags.
Frequently asked questions
Does it change how the page looks?
Formatting only changes whitespace between tags. Rendering normally stays the same.
Can it fix broken HTML?
No. It re-indents what you give it. Use a validator to find structural errors.