Skip to content
Devtoolry

SQL Formatter

Format SQL queries for MySQL, PostgreSQL, SQLite, SQL Server and more with keyword casing options.

About the SQL Formatter

Long SQL queries are much easier to debug when each clause starts on its own line. The SQL Formatter indents queries for the dialect you use and can upper- or lower-case keywords.

Everything runs in your browser, so your input is never uploaded to a server.

How to use the SQL Formatter

  1. Paste one or more SQL statements.
  2. Select your dialect (MySQL, PostgreSQL, SQLite, SQL Server and others) and keyword casing.
  3. Copy or download the formatted SQL.

Frequently asked questions

Why choose a dialect?

Dialects differ in syntax such as quoting, operators and functions. Choosing the right one makes the formatter parse those correctly.

Does it validate my query?

It needs to tokenise the SQL, so badly broken queries are reported, but it does not check table or column names against a database.