Format a SQL query
Format a SQL query
The SQL Formatter restructures whitespace and keyword presentation locally; it does not upload or execute your query.
Paste the query
Paste the SQL statement or script you want to make easier to read into the SQL query editor.
Choose the layout
Set spaces or tabs, an indent width, keyword casing, and your preferred leading or trailing comma style.
Format and copy
Select Format SQL to update the editor, review the line and character summary, then copy the formatted query.
Frequently Asked Questions
Is SQL formatting free?
Yes. The formatter is free to use in your browser.
Is my SQL uploaded?
No. Formatting runs locally in your browser.
Does formatting execute the query?
No. The tool only changes presentation and never connects to a database.
Can I use tabs?
Yes. Choose tabs in the indent style control.
Can I change keyword case?
Yes. Choose uppercase, lowercase, or capitalized keywords.
Can I select a comma style?
Yes. Choose trailing or leading commas for column lists.
Will strings be reformatted?
String literals are preserved while surrounding SQL is formatted.