Skip to content
Utilerio

SQL Formatter

Format and beautify SQL queries for MySQL, PostgreSQL, SQLite and more.

Formatted SQL

The result will appear here.

Was this tool useful?

About this tool

SQL written under pressure — in a monitoring tool, copied from a log, auto-generated by an ORM — is almost always a single unreadable line. Formatting adds indentation and keyword casing that let you follow the logic at a glance.

The formatter supports nine SQL dialects: standard SQL, MySQL, PostgreSQL, SQLite, BigQuery, Transact-SQL (SQL Server), PL/SQL (Oracle), MariaDB, and more. Picking the right dialect ensures the correct reserved-word list is applied.

How to use it

  1. Paste your SQL query.
  2. Select the dialect that matches your database.
  3. Click Format SQL.
  4. Copy the result or send it directly to the API.

Examples

Unformatted → formatted

select id,name,email from users where active=1 and created_at>'2024-01-01' order by name limit 10
SELECT
  id,
  name,
  email
FROM users
WHERE
  active = 1
  AND created_at > '2024-01-01'
ORDER BY name
LIMIT 10

Common problems

The formatter wraps my column list differently than expected.
The formatter follows its own style rules for line length. This is intentional — the output is consistent across all queries, which makes reviews easier.

Frequently asked questions