DevTilt

SQL Formatter

Make SELECT statements and scripts readable with dialect-aware layout. SQL is a format mode in the code tools — there is no separate SQL minifier.

SQL is a formatter mode. There is no SQL minifier.

Result

Paste code, then Format. Processing stays in your browser.

How to format SQL

  1. Paste a query or script.
  2. Pick the dialect that matches your database (ANSI, MySQL, PostgreSQL, SQLite, SQL Server, or MariaDB).
  3. Click Format.
  4. Copy the pretty-printed SQL. There is no SQL minifier on this site.

What is SQL Formatter?

SQL copied from a query log or a colleague's Slack message is often one unreadable line. This formatter breaks SELECT, JOIN, WHERE, and subquery blocks onto separate lines with keyword alignment — the same readability boost you get from IDE formatting, without opening a database client.

Why use DevTilt's SQL Formatter?

  • Keyword-aligned formatting for SELECT, JOIN, WHERE blocks
  • Handles subqueries and nested expressions
  • Supports common dialects including MySQL, PostgreSQL, and SQL Server
  • Indentation for CASE, UNION, and window functions

Common use cases

  • Reading a slow query from a database slow-log export
  • Formatting SQL before posting in a code review or Slack
  • Preparing query examples for internal documentation
  • Debugging a complex JOIN chain from a BI tool export

FAQ

ANSI, MySQL, PostgreSQL, SQLite, SQL Server (T-SQL), and MariaDB — the set sql-formatter supports for this MVP.
No. Demand is weak and minified SQL is rarely what you want in a browser tool. Use this formatter only.
The library often still prints a best-effort layout. If keywords look wrong, change dialect rather than forcing a minify step.
No. sql-formatter runs in your browser. Do not paste production credentials into any online tool; this one at least does not send them.
Pick the dialect closest to your database. JSON operators, T-SQL brackets, or MySQL backticks may layout better under PostgreSQL, SQL Server, or MySQL modes respectively.