Formatter
SQL Formatter
Format and beautify SQL queries online with readable indentation and keyword styling. Process SQL locally in your browser.
Tool
Format and beautify SQL queries online with readable indentation and keyword styling. Process SQL locally in your browser.
This tool runs in your browser. Your input is processed locally and is not uploaded.
About this Tool
Use this free SQL Formatter to turn compact or difficult-to-read SQL into a clear and consistently indented structure. Paste a query, schema definition, stored statement, or SQL script, select a supported database dialect where necessary, and format clauses, joins, conditions, expressions, and nested queries. The SQL is processed locally in your browser and is never executed against a database.
Examples
- SELECT u.id,u.name,COUNT(o.id) AS orders FROM users u LEFT JOIN orders o ON o.user_id=u.id WHERE u.active=true GROUP BY u.id,u.name ORDER BY orders DESC;
- INSERT INTO products(sku,name,price,active)VALUES("1001","Blue Jeans",89.95,true);
- CREATE TABLE orders(id INTEGER PRIMARY KEY,customer_id INTEGER NOT NULL,total DECIMAL(10,2),created_at TIMESTAMP NOT NULL);
Frequently Asked Questions
Which SQL dialects are supported?
The formatter can support common dialects such as standard SQL, MySQL, PostgreSQL, SQLite, SQL Server, Oracle, MariaDB, and others depending on the underlying parser.
Does the formatter execute SQL?
No. Queries are parsed and formatted as text and are never connected to a database.
Can SQL keywords be converted to uppercase or lowercase?
Yes. Keyword casing can be configurable while preserving identifiers, strings, and quoted names.
Is my SQL uploaded?
No. SQL formatting runs locally in your browser.