SQL Formatter & Beautifier
Format and beautify SQL queries online. Supports MySQL, PostgreSQL, SQLite, BigQuery. Free SQL formatter with keyword case options.
Input SQL
Formatted SQL
Frequently Asked Questions
What is a SQL formatter?▾
A SQL formatter (or SQL beautifier) takes a compact or poorly formatted SQL query and reformats it with consistent indentation, keyword casing, and line breaks to make it readable. It helps developers review, debug, and share SQL queries.
Which SQL dialects are supported?▾
The formatter supports Standard SQL, MySQL, PostgreSQL, SQLite, BigQuery, and MariaDB. Each dialect has slightly different syntax rules which the formatter handles appropriately.
Should SQL keywords be uppercase or lowercase?▾
Convention varies, but UPPERCASE keywords (SELECT, FROM, WHERE) is the most common style in SQL and improves readability by visually separating SQL keywords from table and column names. Most SQL style guides recommend uppercase keywords.
How do I minify SQL?▾
Click the Minify button to remove all comments and extra whitespace from your SQL query. Minified SQL is useful for embedding queries in code strings or reducing query length in applications.