HTML Formatter
Beautify HTML, CSS and JavaScript with consistent indentation.
Input
Waiting for input
Output
or press ⌘/Ctrl + EnterYour result appears here.
- Runs in your browser
- Nothing is uploaded
- Free, no sign-up
How to use it
- Paste HTML (or switch the language to CSS or JavaScript).
- Choose the indentation and, optionally, a maximum line length.
- Copy the formatted code.
Why Tool Dock
- FastEverything runs on your own device, so there is no queue and no waiting for uploads.
- PrivateYour files and text never leave the browser. Close the tab and they are gone.
- Batch friendlyDrop several files at once and download each result, or all of them together.
Questions
Will formatting break my page?
Whitespace inside <pre>, <textarea> and inline elements is preserved, so the rendered page stays the same. Scripts and styles embedded in the HTML are formatted too.
What does the line length option do?
0 means never wrap. Any other number wraps long lines of text and attributes at about that column.
Does it minify as well?
Not here. This tool only beautifies; a minifier for production builds belongs in your build tool (for example esbuild, Vite or html-minifier).
Related tools
- JSON Formatter & ValidatorFormat, validate, repair and explore JSON in a real editor, with a tree view and the exact line of any error.
- SQL FormatterFormat messy SQL into readable, consistently indented queries.
- XML FormatterPretty-print or minify XML and see mistakes at a glance.
- Base64 DecodeTurn Base64 back into text, images or files, right in your browser.
- Base64 EncodeTurn text or any file into Base64, right in your browser.
- BIMI CheckerCheck whether your brand logo can show next to your emails: BIMI record, logo, certificate and DMARC.