SQL formatter
Beautify SQL for MySQL, PostgreSQL, SQLite, SQL Server and more.
About this tool
This tool reformats SQL queries with clear line breaks and indentation, so long SELECT, JOIN and WHERE clauses become easy to read. Pick your dialect (MySQL, PostgreSQL, SQLite, SQL Server T-SQL, Oracle PL/SQL, BigQuery and others) and whether keywords should be UPPERCASE, lowercase or left as typed.
At a glance
- What it does
- Beautify SQL for MySQL, PostgreSQL, SQLite, SQL Server and more.
- Price
- Free, no sign-up
- Works in
- Your browser, on phone or computer. Works offline after the first visit.
- Privacy
- What you type never leaves your device.
How to format a SQL query
- Paste your SQL or open a .sql file.
- Choose the SQL dialect, keyword case and indent.
- Copy or download the formatted query.
Private
Your text stays in your browser and is never sent to a server.
Instant
Results update as you type, with nothing to install.
Free
No sign-up, no limits and no ads inside your writing space.
Frequently asked questions
Does formatting change what the query does?
No. Only spaces, line breaks and the letter case of keywords change. Table names, values and the order of everything stay the same.
Why does it say it cannot read my SQL?
The formatter could not parse part of the query, often a missing bracket or a dialect-specific feature. Check the line and column shown, or switch to the dialect your database uses (for example SQL Server for [brackets] and TOP).
Does it check my query against a database?
No. It only formats text. It never connects to a database, so it cannot tell you if a table or column exists.
Is my text sent anywhere?
No. Everything runs in your browser and your text never leaves your device. Nothing is stored on any server.



