Single-line SELECT with a JOIN
A one-line query is broken into clauses, with the JOIN condition indented under its clause.
select u.id from users u join orders o on o.user_id=u.idSELECT u.id
FROM users u
JOIN orders o ON o.user_id=u.idBeautify and minify SQL queries in your browser. Uppercase keywords, indent clauses, and collapse whitespace - no upload required.
Paste a SQL query below.
Paste SQL above or load the example to format or minify.
One tap, no account. Your vote is saved in this browser and counted in our site analytics.
Detects SELECT, FROM, WHERE, JOIN, GROUP BY, ORDER BY, and other major clauses and starts each one on a fresh line with indentation for related sub-clauses.
Recognizes over 30 common SQL keywords like SELECT, JOIN, and HAVING and uppercases them consistently, without touching table or column names.
Tracks single- and double-quoted string boundaries so a semicolon, keyword, or comment marker inside a literal value is never mistaken for real SQL syntax.
Collapses whitespace into a single compact line while keeping -- and /* */ comments attached, so a minified query still carries its original documentation.
Copy a query from your IDE, a slow-query log, a database client, or an ORM-generated statement.
Format uppercases keywords and breaks clauses onto new lines; Minify collapses whitespace for a compact single-line query.
Check that SELECT, FROM, JOIN, and WHERE line up the way you expect, especially in queries with several joins.
Export the result to your clipboard or save it as a .sql file to attach to a ticket or pull request.
Format a one-line generated query from an ORM migration so reviewers can actually read the JOIN and WHERE logic before approving.
Database logs typically store queries as a single line - format one to quickly identify missing indexes or unnecessary joins.
Format CREATE TABLE and migration statements before pasting them into a runbook, changelog, or architecture document.
Minify a formatted query before embedding it in application code or a config file where a multi-line string is inconvenient.
A one-line query is broken into clauses, with the JOIN condition indented under its clause.
select u.id from users u join orders o on o.user_id=u.idSELECT u.id
FROM users u
JOIN orders o ON o.user_id=u.idKeyword casing is normalized and the VALUES clause is indented beneath INSERT INTO.
insert into users (name, email) values ('Ada', 'ada@example.com')INSERT INTO users (name, email)
VALUES ('Ada', 'ada@example.com')All keyword detection, clause breaking, and minification run locally in your browser. Your queries, including anything referencing real table names, column names, or production schema details, are never uploaded to ToolMint servers.
A SQL Formatter is a browser-based utility that beautifies or compacts SQL query text. It detects major clauses like SELECT, FROM, WHERE, and JOIN using keyword patterns, uppercases recognized keywords, and breaks each clause onto its own line with appropriate indentation, while tracking string literals so nothing inside a quoted value gets altered.
Queries generated by an ORM, pulled from a slow-query log, or pasted from a database client usually arrive as one dense line. Reformatting them into clause-broken, consistently cased SQL makes it dramatically faster to spot a missing join condition, review a migration in a pull request, or document a schema change for teammates.
This tool uses keyword and pattern heuristics rather than a true SQL grammar parser, so it does not validate syntax, resolve dialect-specific functions, or guarantee perfect clause placement for unusual or vendor-specific SQL. Comments are preserved rather than stripped during minification, so minified output is compact but not the smallest possible string.
Convert CSV to JSON Without Breaking Your Data
Why CSV to JSON conversions go wrong - quoted commas, line breaks inside cells, delimiters, and lost leading zeros - and how to check the output before it reaches your app.
URL Encoding Explained: Percent Signs, Plus Signs, and Double Encoding
How percent-encoding works, when to use encodeURIComponent versus encodeURI, why spaces sometimes become plus signs, and how to spot double-encoded URLs.
Seven Regex Mistakes That Break JavaScript Code
Unescaped dots, missing anchors, greedy matches, the stateful g flag, and catastrophic backtracking - what each mistake looks like and how to test for it before it ships.
Developer
Format and validate JSON instantly.
Updated Jul 20, 2026
Developer
Check JSON syntax and inspect structure locally.
Updated Jul 20, 2026
Developer
Format and minify HTML instantly.
Updated Jul 20, 2026
Developer
Format and minify CSS instantly.
Updated Jul 20, 2026
See every utility on the all tools page.
Found a problem or missing feature? Tell us - no account required.
Last updated: