Code Beautifier and Minifier

Format and minify HTML, CSS, JavaScript and SQL online with a choice of indentation and SQL dialect. Free, no sign-up, code stays in your browser.

🔒 Runs in your browser

About this tool

Beautify messy code or minify it for production in one place. The tool formats and minifies HTML, CSS, JavaScript and SQL, lets you pick 2 spaces, 4 spaces or tabs, and supports 14 SQL dialects. It shows how much smaller the result is. Free, no sign-up, and your code never leaves your browser.

How to use

  1. Choose the language tab: HTML, CSS, JavaScript or SQL.
  2. Paste your code or click Example to try a sample.
  3. Set the indentation and, for SQL, the dialect and keyword case; for JavaScript, the compress and mangle options.
  4. Click Format or Minify, then copy or download the result.

Frequently asked questions

Is my code sent to a server?

No. Formatting and minification run entirely in your browser, so your code is never uploaded.

Which SQL dialects are supported?

Standard SQL plus PostgreSQL, MySQL, MariaDB, SQLite, SQL Server (T-SQL), Oracle PL/SQL, BigQuery, ClickHouse, Snowflake, Redshift, Spark, DuckDB, Trino. You can also choose whether keywords are written in upper case, lower case or left as they are.

How is JavaScript minified?

JavaScript is minified with Terser. You can turn compression and shortening of variable names (mangle) on or off; comments marked with /*!, @license or @preserve are kept.

What does HTML minification remove?

It removes ordinary comments and collapses extra whitespace while leaving the content of pre and textarea untouched. Inline styles and scripts inside the page are minified too; conditional comments are preserved.