HTML Formatter
Beautify or minify HTML, CSS and JavaScript — choose the indent, wrap length and how attributes are laid out.
Input
568 bytes
Output
703 bytes · +24% · 36 lines
How to use
- Pick HTML, CSS or JavaScript, paste your code and the formatted version appears on the right.
- Beautify re-indents the code. For HTML you can choose how long tags with many attributes are laid out.
<script>and<style>blocks are formatted too. - Minify (HTML and CSS) removes comments and extra whitespace to make files smaller. Text in
<pre>and<textarea>is kept exactly.
Good to know
- Formatting only changes whitespace — it doesn't fix broken tags or check that your code is valid.
- To minify JavaScript safely, use a build tool such as esbuild or Terser.
- Want to see the page itself? Use the HTML/CSS Render tool. Everything runs in your browser.