Code Formatter & Minifier
Format messy code with Prettier or minify production bundles locally in your browser.
Settings
2 spaces · 80 cols · double quotes
How to Use Code Formatter & Minifier in 3 Steps
Paste or open code
Paste a code snippet or drop a source file. Select the language manually if auto-detection misses SCSS, Markdown, or YAML.
Choose Beautify or Minify
Select Beautify to format code with Prettier. Select Minify to strip whitespace, remove comments, and shorten JavaScript identifiers with Terser.
Copy or download output
Review the live output and check the byte-savings badge. Click Copy or Download to save the result with the matching extension.
Code Formatter & Minifier: Frequently Asked Questions
Which formatting and minifying engines run here?
Beautify uses Prettier for web languages and sql-formatter for SQL. Minify uses Terser for JavaScript, CSSO for CSS, and built-in parsers for JSON, HTML, and XML.
Is minified JavaScript safe for production?
Yes. Terser preserves runtime behavior. Clear "Shorten variable names" if external scripts call your local functions by name.
What does the HTML minifier remove?
It removes HTML comments and whitespace between block tags. It preserves inline text spacing and leaves <pre>, <textarea>, <script>, and <style> blocks untouched.
Why is Minify unavailable for TypeScript, SCSS, and Markdown?
Browsers do not execute those source formats directly. Compile TypeScript or SCSS first, then minify the generated JavaScript or CSS output.
Which SQL dialects are supported?
Settings support Standard SQL, MySQL, MariaDB, PostgreSQL, SQLite, DuckDB, BigQuery, T-SQL, PL/SQL, Snowflake, Redshift, Spark, Hive, Trino, Db2, SingleStore, TiDB, and N1QL.
Why does the status say "Loading formatter..." on first run?
Each language parser downloads once on first use and stays in your browser cache. Subsequent runs format your code immediately.
Is my input uploaded to a server?
No. Every calculation and parser runs locally inside your browser tab. Your code, secrets, cookies, and files never leave your device.
Explore All Dev Tools
Format, minify, inspect, and validate code and developer payloads locally.