Format SQL queries with proper indentation and uppercase keywords
Formatted SQL will appear here...
Query data with JOINs, WHERE, ORDER BY, GROUP BY, HAVING, LIMIT
Insert data with INTO, VALUES, and column lists
Update records with SET and WHERE conditions
Remove records with FROM and WHERE clauses
SELECT users.name, orders.total FROM users INNER JOIN orders ON users.id = orders.user_id
INSERT INTO users (name, email)
VALUES ('John', '[email protected]')UPDATE users SET status = 'active' WHERE created_at > '2024-01-01'
DELETE FROM orders WHERE status = 'cancelled' AND created_at < '2023-01-01'
Our SQL Formatter is a free online tool for beautifying and formatting SQL queries. Transform messy, one-line SQL into readable, properly indented code with uppercase keywords.
Why format SQL? Well-formatted SQL is easier to read, debug, and maintain. Proper indentation and line breaks make complex queries more understandable, especially when working with JOINs, subqueries, and WHERE clauses. Clean SQL improves code reviews and team collaboration.
Features: Automatic indentation with customizable spacing (2, 4, or 8 spaces), optional uppercase keywords for SQL reserved words, proper line breaks for SELECT, FROM, WHERE, JOIN, and other clauses, and formatted comma-separated column lists. Supports all major SQL databases including MySQL, PostgreSQL, SQL Server, Oracle, and SQLite.
How to use: Paste your messy SQL query into the input area. The tool automatically formats it with proper indentation and structure. Toggle uppercase keywords and adjust indent size to match your style guide. Copy the formatted SQL with one click. Perfect for database developers, data analysts, and anyone working with SQL!