SQL Formatter

Free

Format and beautify SQL queries for MySQL, PostgreSQL, SQLite and more with syntax highlighting.

18 keywords2 tables284 chars
spaces
Input284 chars
Formatted284 chars
SELECT
u.id,
u.name,
u.email,
COUNT(o.id) AS order_count,
SUM(o.total) AS total_spent
FROM users u
LEFT
JOIN orders o
ON u.id = o.user_id
WHERE u.created_at > '2024-01-01'
AND u.status = 'active'
GROUP BY u.id, u.name, u.email
HAVING COUNT(o.id) > 0
ORDER BY total_spent DESC
LIMIT 50

About SQL Formatter

Format messy or minified SQL queries into clean, readable code with proper indentation. Supports keyword casing (UPPER, lower, preserve), multiple SQL dialects and syntax highlighting for keywords, strings, numbers and operators. Use the quick snippets to load example queries instantly.

Reviews

Sign in to write a review