HTML, CSS & JavaScript Formatter
Turn minified or messy code into clean, readable, consistently indented code.
- Runs in your browser — nothing uploaded
- Instant, no waiting in a queue
- Free, no watermark, no daily limits
Paste HTML, CSS or JavaScript and beautify it with consistent indentation using the open-source js-beautify engine — including the CSS and scripts embedded in an HTML page. Choose 2 spaces, 4 spaces or tabs, and optionally put each HTML attribute on its own line. Minify is available for HTML (comments and whitespace between tags removed, while pre, textarea, script and style blocks are left intact) and CSS. JavaScript minification is not offered, because doing it safely needs a full compiler.
How to Format HTML, CSS or JavaScript
- 1
Choose the language
Select HTML, CSS or JavaScript, or open a file and the language is picked from its extension.
- 2
Paste your code
Paste the code and choose an indent size.
- 3
Beautify or minify
Click Beautify for readable code or Minify (HTML/CSS) for a smaller file, then copy or save it.
Why use ToolzBank HTML, CSS & JS Formatter?
- Beautifies HTML, CSS and JavaScript
- Formats CSS and JS inside HTML pages
- 2 spaces, 4 spaces or tab indentation
- Optional one-attribute-per-line HTML
- HTML and CSS minifier with size change
- Open .html, .css or .js files and save the result
Frequently asked questions
What does an HTML beautifier do?
Can it format CSS and JavaScript too?
Will minifying HTML break my page?
Why can’t I minify JavaScript?
Is my code uploaded?
More free developer tools
JSON Formatter & Validator
Beautify, minify & validate JSON
JSON to CSV
Flatten JSON arrays into CSV/Excel
XML Formatter
Pretty-print & validate XML
JWT Decoder
Decode & verify JSON Web Tokens locally
Regex Tester
Test regular expressions live
Timestamp Converter
Unix epoch ⇄ human-readable dates
Diff Checker
Compare two texts line by line
Base64 Encoder / Decoder
Encode & decode Base64 text and files
URL Encoder / Decoder
Percent-encode, decode & parse URLs
Hash Generator
MD5, SHA-1, SHA-256 & SHA-512 for text or files
Number Base Converter
Binary, octal, decimal & hex conversion
PX to REM Converter
Convert px ⇄ rem, or a whole stylesheet
Color Converter
HEX, RGB, HSL, HSV & CMYK with contrast check
YAML to JSON Converter
Convert YAML ⇄ JSON with error lines
SQL Formatter
Beautify SQL for MySQL, PostgreSQL & more
Markdown Editor
Write visually, download a .md file
From Our Blog
How to Format SQL Queries (MySQL, PostgreSQL and More)
Readable SQL is easier to debug and review. Learn simple formatting conventions and beautify any query for MySQL, PostgreSQL, SQL Server and more.
How to Format and Validate XML Online (Pretty Print or Minify)
Make one-line XML readable, find the exact line of a syntax error, or minify XML — for sitemaps, RSS feeds, SVG and config files.
How to Beautify and Minify HTML, CSS and JavaScript Code
When to beautify code and when to minify it, what each really changes, and how to format HTML, CSS and JavaScript or shrink HTML and CSS in one click.
