SQL Formatter
Format and beautify SQL queries with dialect and keyword case options.
Formatted SQL appears here.About the SQL Formatter
This SQL formatter takes a dense or hand written query and rewrites it with consistent indentation, line breaks, and keyword spacing so it reads cleanly. Paste a SELECT, INSERT, UPDATE, or a long join chain and get back a tidy version you can drop straight into a migration file, a code review, or a report.
You can pick the SQL dialect that matches your database, including standard SQL, PostgreSQL, MySQL, SQLite, MariaDB, and BigQuery. Choosing the right dialect helps the formatter understand functions, quoting, and syntax that differ between engines, so the output stays valid for your target system instead of being normalized into something generic.
A keyword case option lets you decide how reserved words such as SELECT, FROM, WHERE, and JOIN appear. Leave them exactly as written, force them to uppercase for the classic readable style many teams prefer, or lowercase them to match a particular house style. The choice applies instantly so you can compare both and keep whichever fits your codebase.
Everything happens in your browser. The query you paste is formatted locally on your own device using JavaScript, and nothing is uploaded, logged, or sent to any server. That makes it safe to tidy up queries that mention real table names, internal schemas, or other details you would rather not share.
Reach developers and designers who use these tools every day. Privacy-first, no trackers.
Frequently asked questions
How do I format a SQL query?
Paste your query into the input box. The formatter reindents it and adds line breaks automatically as you type, and the cleaned result appears in the output panel ready to copy.
Which SQL dialects are supported?
You can format standard SQL, PostgreSQL, MySQL, SQLite, MariaDB, and BigQuery. Pick the dialect that matches your database so engine specific syntax is handled correctly.
Can I control whether keywords are uppercase or lowercase?
Yes. The keyword case option lets you preserve the original casing, force keywords like SELECT and WHERE to uppercase, or convert them to lowercase to match your style.
Will the formatter fix or validate broken SQL?
It focuses on layout, not correctness. It reformats valid syntax and will show a calm message if a query cannot be parsed, but it does not check that tables, columns, or logic are correct.
Is my SQL uploaded or stored anywhere?
No. Formatting runs entirely in your browser and your query never leaves your device, so it is safe to use with queries that reference private schemas or internal table names.