0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
Configuration
Format SQL queries with capitalized keywords and clear indentation according to the selected dialect: MySQL, PostgreSQL, SQL Server, SQLite, and more. Select the dialect, paste the query into the editor, and press Format.
Source code
Lines:0Characters:0

How it works

Reindents and aligns SQL queries to make them readable and consistent. It separates clauses, columns, and conditions into clear lines, which makes it easier to review long queries, compare versions, or document reports.

You can choose the dialect (for example, standard SQL, PostgreSQL, MySQL, SQLite, T-SQL, among others) so that keywords and syntax are interpreted correctly, as well as the case of reserved words.

It also controls the indentation type and size and the line ending. Everything is processed in your browser with sql-formatter; it only changes the format, never executes or validates the query against a database.

Examples

select id,name from users where active=1 order by nameSELECT id, name FROM users WHERE active = 1 ORDER BY nameWith keywords in uppercase: each clause and column goes on its own line.

Use cases

  • Make a long query copied from a log or an ORM readable.
  • Standardize the style of queries before saving them in the repository.
  • Review and compare queries from different dialects with a uniform format.
  • Document reports or views with neatly indented SQL.

Frequently asked questions

Which SQL dialects does it support?

It supports several dialects, such as standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, Transact-SQL, and others. Choosing the right one ensures that keywords and specific syntax are formatted well.

Does it execute or validate the query?

No. The tool only rearranges and aligns the query text. It does not connect to any database or check that the query is valid or safe.

Can I put keywords in uppercase or lowercase?

Yes. You can choose to have reserved words (SELECT, FROM, WHERE) in uppercase, lowercase, or exactly as you typed them, according to your style convention.

Is my query uploaded to a server?

No. Formatting happens entirely in your browser; the query never leaves your computer.