Clean Syntax & Standardized Uppercase Keywords
Transform inconsistent casing into professional SQL convention with standardized keywords, indented clauses, and formatted column lists.
Free online SQL Formatter and Beautifier. Format PostgreSQL, MySQL, SQLite, and SQL Server queries with uppercase keywords, customizable indentation, and complete browser privacy.
Instant client-side SQL prettifier and minifier
SELECT u.id,
u.email,
u.full_name,
COUNT (
DISTINCT o.id
) AS total_orders,
COALESCE (
SUM (
o.total_amount
),
0
) AS total_spent,
MAX (
o.created_at
) AS last_order_date
FROM users u
INNER JOIN user_profiles up
ON u.id = up.user_id
LEFT JOIN orders o
ON u.id = o.user_id
AND o.status IN (
'completed',
'shipped'
)
WHERE u.created_at >= '2025-01-01'
AND u.is_active = TRUE
AND (
up.country_code = 'US'
OR up.country_code = 'CA'
)
GROUP BY u.id, u.email, u.full_name
HAVING COUNT (
o.id
) >= 3
ORDER BY total_spent DESC, total_orders DESC
LIMIT 50;A database administrator extracts an unformatted, compact SQL query from application logs and formats it for debugging and indexing review.
| Raw Input Query | with recent_orders as (select user_id,sum(total) as order_volume from orders where created_at>=now()-interval '30 days' group by user_id) select u.id,u.email,r.order_volume from users u inner join recent_orders r on u.id=r.user_id where u.status='active' order by r.order_volume desc limit 25; |
| Formatted SQL Query | WITH recent_orders AS ( SELECT user_id, sum(total) AS order_volume FROM orders WHERE created_at >= now() - interval '30 days' GROUP BY user_id ) SELECT u.id, u.email, r.order_volume FROM users u INNER JOIN recent_orders r ON u.id = r.user_id WHERE u.status = 'active' ORDER BY r.order_volume DESC LIMIT 25; |
💡 The beautified query reveals the inner CTE structure and join conditions clearly, simplifying optimization and query plan analysis.
Paste your raw, messy, or single-line SQL query into the input editor, or select from database query presets.
Choose your formatting options including keyword case (UPPERCASE or lowercase) and indent size (2 spaces, 4 spaces, or tabs).
Click Beautify to neatly indent clauses, joins, and subqueries, or click Minify to compress the query into a compact single line.
Copy the formatted SQL to your clipboard or download it as a .sql file ready for your database client or migration script.
Transform inconsistent casing into professional SQL convention with standardized keywords, indented clauses, and formatted column lists.
Works across PostgreSQL, MySQL, MariaDB, SQLite, SQL Server (T-SQL), Oracle, Snowflake, and BigQuery without dialect incompatibilities.
Beautify queries for readable git diffs and documentation, or minify them into single-line strings for environment variables and CLI scripts.
It supports all ANSI SQL standards as well as popular dialects including PostgreSQL, MySQL, MariaDB, SQLite, Microsoft SQL Server (T-SQL), Oracle, and Snowflake.
No. All tokenization, keyword capitalization, indentation, and minification run 100% locally in your web browser. Your table names, schemas, and queries never leave your machine.
Yes. The Minify button collapses excess whitespace, strips single-line and multi-line comments, and produces a clean single-line SQL string ready for code or CLI execution.
Developer Tools
Format, beautify, validate, and minify JSON data online with instant syntax error highlighting and tree inspection.
Convert cURL command lines into production-ready code snippets for JavaScript Fetch, Axios, Python Requests, Go net/http, PHP cURL, and Node.js.
Compare two JSON structures side-by-side with automatic key sorting, colored difference highlights, and change breakdown.
Decode, inspect, and verify JSON Web Tokens (JWT) online. View claims, expiration dates, signature verification, and build tokens safely 100% in your browser.
Generate secure, cryptographically random Version 4 (v4) and time-ordered Version 7 (v7) UUIDs and GUIDs with custom formatting, bulk batch generation, and live inspection.
Explore, navigate, and inspect complex JSON payloads with an interactive collapsible tree viewer, type badges, node search, and JSON path copying.