
SQL Formatter
Pretty-print SQL queries with support for MySQL, PostgreSQL, and many other dialects.
Created by sql-formatter-org
Create a free account to get instant access
How to Use
This tool formats and prettifies SQL queries to improve readability. Paste messy SQL code and get clean, properly indented output. 1. Type or paste your SQL query in the left text area 2. The formatted result appears automatically in the right text area 3. Use the options panel on the left to customize formatting: - Select your SQL dialect (MySQL, PostgreSQL, BigQuery, etc.) - Adjust indentation (tab width, use tabs vs spaces) - Change case for keywords, functions, and data types - Control line breaks and spacing Key controls: - Left textarea: Input your unformatted SQL - Right textarea: View the formatted output (read-only) - Options panel: Adjust formatting preferences - All changes apply instantly as you type or modify settings The tool supports many SQL dialects and handles complex queries with joins, subqueries, and multiple statements. If there's a syntax error, an error message will display instead of formatted output.