SQL Formatter

Format or minify a SQL query without touching any text or number

calendar_today Last updated: October 9, 2026

Result

check_circle

Checked: no string, number or operator was changed — only spacing and keyword case.

This lays a query out; it does not check that it is valid SQL for your database. Runs in your browser — the query never leaves your device.

lightbulb

Sahel's SQL formatter lays a query out or minifies it, and checks that nothing but spacing and keyword case changed.

help_outline

How does this tool work?

1

Paste the query

On one line or tangled.

2

Choose the layout

Neatly formatted or minified to one line.

3

Copy the result

With a check that the content did not change.

Frequently asked questions

Does it change what the query does? expand_more
No. Only spacing and keyword case change, and the tool verifies that itself.
Does it validate the SQL? expand_more
No. It formats; it does not analyse or run the query.
Which dialects work? expand_more
The common syntax shared by MySQL, PostgreSQL, SQL Server and SQLite.
Are my queries sent anywhere? expand_more
No. Everything stays in your browser, which matters if they contain internal table names.