[
megatools
]$
$
Tools
Search tools...
Ctrl+K
Support
$ cd ../
SQL Formatter & Beautifier
Format, indent, and beautify complex SQL queries in your browser.
MODE
Beautify
Minify
DIALECT
Standard SQL
PostgreSQL
MySQL
SQLite
T-SQL (MS SQL)
BigQuery
KEYWORD CASE
UPPERCASE
lowercase
Preserve
INDENT
2 spaces
4 spaces
SQL Input Query
clear
select u.id, u.username, u.email, count(o.id) as total_orders, sum(o.amount) as total_spent from users u left join orders o on u.id = o.user_id where u.active = 1 and u.created_at >= '2026-01-01' group by u.id, u.username, u.email having count(o.id) > 5 order by total_spent desc limit 50;
Formatted SQL
copy sql
Download .sql
?