Skip to content
OneTooling

SQL Formatter

Format messy SQL into readable, indented queries for PostgreSQL, MySQL, SQL Server, BigQuery, and more. Your queries stay in your browser.

Runs in your browser · nothing uploaded
Keywords
Indent

Why is there an ad? This tool is free and runs on your device. One small ad pays for hosting and new tools. No pop-ups, no autoplay, never inside the tool. How we make money

How to format SQL

  1. Paste your query, or open a .sql file.
  2. Choose your database dialect, keyword style, and indent.
  3. Copy the formatted SQL or download it.

Questions

Are my queries sent anywhere?

No. Formatting runs in your browser, so table names, data, and business logic in your SQL stay private.

Does formatting change what the query does?

No. Only spaces, line breaks, and keyword capitals change. The query runs exactly the same.

Why choose a dialect?

Databases differ in syntax, such as quoting, special operators, and keywords. Picking yours avoids mistakes with things like PostgreSQL casts (::), MySQL backticks, or T-SQL brackets.

Can it format several queries at once?

Yes. Queries separated by semicolons are each formatted, with a blank line between them.

Credits

Built on sql-formatter (MIT). OneTooling is not affiliated with that project.