A simple SELECT
"select id, name from users where active = 1 order by name" breaks onto 4 lines, one starting with each of SELECT, FROM, WHERE and ORDER BY.
Format and beautify SQL queries online for easier reading and review — free SQL formatter.
A lightweight line-breaker for readability — it does not parse or validate SQL syntax.
About
Breaks a SQL query onto separate lines at major keywords like SELECT, FROM, WHERE and JOIN, so it's easier to scan and review.
Developers use it to make a query pasted from a log or a one-line ORM debug dump readable again, and database administrators use it to tidy up a query before including it in documentation or a code review. It's one of many free developer tools on Toolapt, and like every tool here, it's free to use with no sign-up and no limit on how many times you run it.
Examples
3 worked examples
"select id, name from users where active = 1 order by name" breaks onto 4 lines, one starting with each of SELECT, FROM, WHERE and ORDER BY.
"left join" is recognized as a single keyword, so the whole join clause stays together on its own line instead of splitting after "left".
"insert into users (name, email) values (...)" breaks into an INSERT INTO line and a VALUES line, with column names and values left untouched.
FAQ
Quick answers to common questions about the SQL Formatter.
It breaks a SQL query onto separate lines at major keywords like SELECT, FROM, WHERE and JOIN, to make it easier to read.
Yes. It's free, with no sign-up, no watermark and no limit on how many times you use it.
Yes. Formatting happens entirely on your own device — nothing you paste is sent to a server.
No. It's a lightweight line-breaker for readability only — it doesn't parse, validate or execute the query.
It's dialect-agnostic: it looks for common keywords shared across most SQL dialects (MySQL, PostgreSQL, SQL Server, SQLite and others) rather than parsing any one dialect's full grammar.
No. Since it doesn't parse the query, it won't detect or fix syntax errors — it only reformats line breaks.
No. It only inserts line breaks and normalizes surrounding whitespace; it never changes the query's keywords, identifiers or values.
Yes. The page is fully responsive and works on mobile, tablet and desktop browsers alike.
Did SQL Formatter work for you?