Why format and minify code?
Formatting rewrites code with consistent indentation, line breaks and spacing so it is easy to read, review and diff, which helps with minified snippets, generated SQL or copied config files. Minifying does the opposite: it removes whitespace and comments (and for JavaScript also shortens local names with Terser) to reduce download size. This tool uses Prettier, the formatter most JavaScript projects already use, and sql-formatter, which knows the syntax of MySQL, PostgreSQL, SQL Server, Oracle PL/SQL, BigQuery and more.
Features
- • 11 languages: JavaScript, TypeScript, JSON, CSS, SCSS, Less, HTML, SQL, YAML, Markdown, GraphQL
- • 13 SQL dialects with keyword case options
- • Minify JS (Terser), CSS, HTML, JSON and SQL with size savings
- • Indent size or tabs, line width, quotes and semicolons
- • Copy or download the result, with clear syntax error messages
Your code stays local
Formatting and minifying run entirely in your browser, so API keys, internal queries or proprietary code you paste are never uploaded.