RikiNow Tools
Tools
About
en
sv
zh
SQL prettifier
Format SQL with sensible defaults, clear options, and compact output when needed.
Dialect
MySQL
PostgreSQL
Oracle
T-SQL
Indent
Auto detect
Spaces
Tabs
Tab width
2
4
Wrap width
Blank lines
0
1
2
Keyword case
UPPER
lower
Preserve
Alignment
Left
River left
River right
AND / OR newline
Before operator
After operator
Detected indent
2 spaces
Comments
Preserved
Clear
Single line
Use output
Input
select u.id, u.email, p.plan_name from users u left join plans p on p.id = u.plan_id where u.deleted_at is null and (u.status = 'active' or u.status = 'trial') order by u.created_at desc;
Output
SELECT u.id, u.email, p.plan_name FROM users u LEFT JOIN plans p ON p.id = u.plan_id WHERE u.deleted_at IS NULL AND ( u.status = 'active' OR u.status = 'trial' ) ORDER BY u.created_at DESC;