Tidy up messy SQL in one click with this free SQL formatter. Paste your query and it puts each major clause on its own line while uppercasing keywords — making SELECTs, JOINs and WHEREs far easier to read and debug.
How to Use
- Paste your SQL query into the input box.
- Click Format SQL.
- Read the tidied query with each clause on its own line.
- Use Copy Result to grab the formatted SQL for your editor.
- Use Clear to start over with a new query.
Key Features
- Clause per line. SELECT, FROM, WHERE, GROUP BY and friends each start on a fresh line.
- Keyword uppercasing. JOINs, ANDs, ORs and other keywords are normalised to capitals.
- Smart indentation. AND and OR conditions are indented under WHERE for clarity.
- One-click copy. Copy the formatted result straight to your clipboard.
- Private and instant. Everything runs in your browser; your queries never leave your device.
FAQs
Which SQL dialects does it support?
It uses generic formatting rules that work with standard queries from MySQL, PostgreSQL, SQLite and SQL Server. It formats layout and capitalisation rather than dialect-specific syntax.
Does it check my SQL for errors?
No. It only reformats the layout; it does not validate syntax or run the query. Always test queries against your database.
Is there a size limit?
There is no hard limit, but very large scripts with tens of thousands of lines may take a moment to format in the browser.
Is any of my data stored?
No. All formatting happens locally in your browser, and your SQL never leaves your device.