Skip to main content

SQL Formatter

Format and beautify SQL queries online for free. Supports MySQL, PostgreSQL, SQLite, and more.

Input SQL

Formatted

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;

Minified

275 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;

حول هذه الأداة

Format and beautify SQL queries for better readability. Supports SELECT, INSERT, UPDATE, DELETE, CREATE, and complex queries with subqueries, JOINs, and CTEs. Configurable indentation and keyword casing.

كيفية الاستخدام

  1. Paste SQL

    Paste your SQL query.

  2. Set Options

    Choose indentation, keyword case, and SQL dialect.

  3. Format

    Click Format and copy the beautified query.

حالات الاستخدام

Code Review

Format minified or poorly indented SQL before reviewing or committing.

الأسئلة الشائعة

Which SQL dialects are supported?

The formatter handles standard SQL syntax compatible with MySQL, PostgreSQL, SQLite, and SQL Server.

Sawbank

أدوات PDF احترافية - مجانية وخاصة

Security

  • Client-side processingFiles never leave your device
  • No file uploads100% private & secure

Compliance

GDPR Compliant
خصوصية 100% - الملفات لا تغادر جهازك
اختيار اللغة

© 2026 Sawbank. جميع الحقوق محفوظة.