CSS Beautifier
Reformat CSS with consistent indentation and spacing.
Turn messy, minified or copy-pasted HTML into neatly indented, readable markup. Inline <style> and <script> blocks are formatted too.
Paste or type to begin. Everything runs in your browser.
How it works
Paste HTML, drop an .html file onto the input, or load the sample.
Choose an indent and whether long lines should wrap. Inline scripts and styles are formatted too.
Copy the clean markup or download it as an .html file.
About this tool
An HTML beautifier takes unstructured or minified HTML and reformats it with consistent indentation, line breaks and spacing, so the nesting of elements is obvious at a glance. It's invaluable for developers, webmasters and anyone working with templates, email HTML, CMS exports or code copied from browser DevTools.
Well-formatted HTML is easier to debug, review and share with your team. You can spot unclosed tags, misplaced elements and accessibility issues faster, and keep a consistent code style across a project.
Formats whole pages or fragments, including inline CSS and JavaScript.
2 spaces, 4 spaces or tabs, with optional line wrapping at 80 or 120 characters.
Keep <a>, <strong> and other inline elements on the same line as their text.
Open .html files directly and save the result as a file.
FAQ
In almost all cases, no. Only whitespace between tags changes. Whitespace inside <pre> and <textarea> is preserved.
Yes. Table-heavy email HTML is formatted the same way, which makes nested tables much easier to follow.
It reformats what's there but doesn't rewrite your markup. Clear indentation does make unclosed or misplaced tags much easier to spot.
No. This tool runs entirely in your browser using JavaScript. Your files and text never leave your device, so it's safe for private or confidential work.
Missing something?
Instant.tools grows from real requests. Describe the task you're stuck on and we'll consider building it next.