SQL Formatter
Format SQL queries with a selected dialect and consistent uppercase keywords, without connecting to a database.
Loading tool…
How to use SQL Formatter
Make SQL easier to review with indentation and line breaks. Formatting runs locally and never executes a statement or opens a database connection.
- Paste a query or SQL script.
- Select the dialect used by your database.
- Format and review the result before using it.
Good to know
- Formatting does not execute, optimize, or fully validate a query.
- Up to 50,000 input characters. Some vendor extensions and template languages are unsupported.
- Always review changes before running SQL in a database.
Common questions
Does the formatter need database credentials?
No. It works entirely with the text you provide.
Does uppercase formatting change string values?
Only recognized SQL keywords are uppercased; string literals retain their content.
Keep going with related tools
All developer →JSON Formatter
Format and indent valid JSON in your browser, with downloadable output and clear syntax errors.
DeveloperRegex Tester
Test JavaScript regular expressions in an isolated worker with a 250 ms timeout and readable match positions.
FilesSQLite Snapshot Schema Inspector
Read schema objects and selected file-header metadata from a bounded standalone SQLite rollback-journal snapshot without executing SQL.
DeveloperPostgreSQL Query Plan Explorer
Explore supplied EXPLAIN JSON with node hierarchy, estimates and explicitly labeled actual metrics.
DataCSV to SQL Inserts
Generate quoted SQLite or PostgreSQL INSERT statements from CSV without executing SQL.