SQL Formatter
Format and beautify SQL queries with syntax highlighting
How to Use SQL Formatter
Format messy SQL queries into clean, readable code with proper indentation. Supports multiple SQL dialects and customizable formatting options.
- 1
Paste your SQL
Paste your unformatted SQL query into the input editor. Click "Sample" to try with example data.
- 2
Choose dialect & options
Select your SQL dialect (MySQL, PostgreSQL, etc.), indentation style, and keyword case preference.
- 3
View formatted output
The formatted SQL appears in the output editor with syntax highlighting and line numbers.
- 4
Copy the result
Click Copy to grab the formatted query for your project or documentation.
Frequently Asked Questions
What SQL dialects are supported?
This tool supports standard SQL, MySQL, PostgreSQL, MariaDB, and other common SQL dialects.
Can I change the indentation?
Yes, you can choose between 2 spaces, 4 spaces, or tabs for indentation.
Does it uppercase keywords?
Yes, you can optionally convert SQL keywords (SELECT, FROM, WHERE, etc.) to uppercase for better readability.
Is this tool free?
Yes, completely free with no signup required. All formatting happens in your browser.