FormatCodes
Home/SQL Tools/SQL Formatter

SQL Formatter

Format and validate SQL queries online for free, right in your browser.

Local browser processing
No sign-up required
Supports multiple SQL dialects
Language
SQLinput.sql
Indent
Keyword
Quick format
InputEditable
1
2
3
4
5
6
7
8
OutputSQL valid18 lines · 221 B
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
SELECT
u.id,
u.name,
count(o.id) AS order_count
FROM
users u
LEFT JOIN orders o ON o.user_id = u.id
WHERE
u.active = 1
GROUP BY
u.id,
u.name
HAVING
count(o.id) > 0
ORDER BY
order_count DESC
LIMIT
20;
UTF-8 · Indent: 2 spaces · Dialect: Standard SQLLocal processing · Ready
How It WorksSQL
Overview
This SQL formatter cleans up minified or inconsistently indented queries into a readable format with unified indentation and keyword case, supporting MySQL, PostgreSQL, SQLite, SQL Server, BigQuery, and other dialects. Everything runs locally in your browser; your data never leaves your device.
Use Cases
Clean up queries minified onto a single lineUnify a team's SQL code styleCheck queries for syntax errorsPrepare readable SQL examples for documentation
Steps
123
Paste or uploadChoose dialect and optionsGet the result

Related Tools

Related Guides

Frequently Asked Questions

Search Tools

Search 55+ formatting, conversion, minification, diffing, and generation tools