Paste your SQL query into the input area on the left, or upload a .sql file using the upload button.
Select your SQL dialect from the dropdown: Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, T-SQL, PL/SQL, BigQuery, Redshift, Spark SQL, or Snowflake.
Choose your indentation style — 2 spaces or 4 spaces — and whether to uppercase SQL keywords.
Click the Format button or press ⌘↵ (Mac) / Ctrl+Enter (Windows) to beautify your SQL instantly.
Copy the formatted output with ⌘⇧C, or download it as a .sql file.
Support for 11 SQL dialects: Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, T-SQL (SQL Server), PL/SQL (Oracle), BigQuery, Amazon Redshift, Spark SQL, and Snowflake.
Configurable indentation: 2 spaces or 4 spaces to match your team's coding standards.
Keyword uppercasing to enforce consistent ALL-CAPS SQL keywords across your codebase.
SQL minifier: collapses formatted SQL to a single line for production use, removing unnecessary whitespace.
SQL validator with multi-pass error detection: balanced parentheses and quotes, valid statement keywords, LIMIT/OFFSET type checks, and dialect-level parse validation.
Syntax highlighting with color-coded keywords, strings, numbers, and comments.
Line numbers in the input panel for easy error location.
Shareable URLs: compress your SQL into a gzip URL parameter for sharing with teammates.
Works entirely in your browser — no SQL is sent to any server. Your data stays private.
Keyboard shortcuts for power users: ⌘⇧F to format, ⌘⇧M to minify, ⌘⇧V to validate.
The SQL Formatter supports 11 SQL dialects. Select the right dialect for accurate formatting and keyword recognition.