SQL query formatter & minifier
Beautify messy inline SQL queries with uppercase clauses and clean indentation—or minify whitespace into single-line strings—while keeping string literals untouched.
SELECT u.id, u.email, count(o.id) as orders FROM users u LEFT JOIN orders o ON o.user_id = u.id WHERE u.status = 'active' AND u.created_at >= '2026-01-01' GROUP BY u.id, u.email ORDER BY orders desc LIMIT 25
Processing runs inside your browser without accounts or server uploads. Modular TypeScript domain logic tested locally.
Report a problem with this toolLiteral-safe SQL formatting
Preserved strings: Quoted string values inside WHERE clauses remain completely unchanged during keyword casing and line breaks.
Frequently asked questions
- Does this connect to any database?
- No—formatting happens purely client-side via deterministic token rules.
- Which SQL dialects are supported?
- Standard ANSI SQL, PostgreSQL, MySQL, SQLite, and SQL Server SELECT/JOIN/INSERT/UPDATE queries.
Related tools
Browse all toolsWeb & SEO
HTML, CSS & SQL formatter
Pretty-print or minify HTML markup, CSS stylesheets, and SQL queries deterministically inside your browser.
Spreadsheets & data
CSV to Markdown, HTML, SQL & LaTeX
Transform CSV spreadsheets into Markdown pipe tables, clean HTML tables, escaped SQL INSERT rows, or LaTeX tabulars.
Developer tools
JSON formatter & validator
Format, minify, and validate JSON syntax with exact line and column error reporting inside your browser.