new Developer Tools

SQL Formatter

Paste a SQL query, choose your formatting preferences, and format it privately in your browser.

Format a SQL query

Use Ctrl+Enter to format. Your query remains in this browser.

0 characters | 0 lines
Formatting summary
Ready
Format a query to see processing details.
Details
No query formatted yet.

Format a SQL query

The SQL Formatter restructures whitespace and keyword presentation locally; it does not upload or execute your query.

1

Paste the query

Paste the SQL statement or script you want to make easier to read into the SQL query editor.

2

Choose the layout

Set spaces or tabs, an indent width, keyword casing, and your preferred leading or trailing comma style.

3

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.