Formatter

SQL formatter

Paste a query and press Format. It runs in your browser, so your SQL never leaves your device.

Want to see what it returns? Run it in the playground on the employees sample database.

Common questions

Is my SQL sent to a server?
No. The formatter runs in your browser. Nothing you paste is uploaded or stored.
Which databases does it support?
Standard SQL plus PostgreSQL, MySQL, SQLite, SQL Server, Oracle, BigQuery, Snowflake, Redshift, MariaDB and DuckDB. Pick yours so its own keywords and functions are recognized.
Does formatting change what my query does?
No. Format only changes spaces, line breaks and the case of keywords. One line also turns each line comment into a block comment, so the comment cannot swallow the rest of the query.
Can I run the query here?
Yes, if it reads the sample data. The playground runs SQLite on four sample databases in your browser.

Formatting uses the open-source sql-formatter library (MIT license).

Practice on your iPhone

Query Dojo for iPhone has 85 interview questions, timed mock interviews and a tile builder, so you can write queries without a keyboard.

Get the app