HomeSQLSQL Formatter
SQL Formatter
Indent and beautify SQL queries — supports MySQL, PostgreSQL, SQLite, and T-SQL.
100% Client-Side · No Upload
Loading tool…

What is SQL Formatter?

SQL Formatter converts messy database queries into neat, standardized layouts. It aligns SELECT fields, capitalizes SQL commands, and handles complex structures like JOINs and subqueries for MySQL, PostgreSQL, SQLite, and Oracle.

How to use SQL Formatter?

1
Paste your unformatted SQL query into the input area.
2
Configure preferences: uppercase keywords, indent style, or specific dialects.
3
Click "Format" or press Ctrl+Enter to execute.
4
Copy the beautiful query or download it as a .sql file.

Interactive Example

Format a complex SELECT querySQL
Input / Sample Source
select id,name,email from users left join orders on users.id=orders.user_id where created_at > '2024-01-01'
Output / Result
SELECT
    id,
    name,
    email
FROM users
LEFT JOIN orders ON users.id = orders.user_id
WHERE created_at > '2024-01-01'

Benefits & Features

Standardized ConventionsStandardizes formatting with UPPERCASE keywords and clean indents.
Supports All DialectsWorks with PostgreSQL, MySQL, MS SQL, SQLite, and MariaDB.
Readable CTEsBeautifully structures nested schemas, tables, and complex configurations.
100% PrivacyKeeps your database schema confidential by running completely client-side.

Frequently Asked Questions