JSON and Data
Processed locally in your browser — not uploaded
SQL Query Formatter & Minifier
Format raw or minified SQL queries into clean, indented multi-line statements or compress them into single-line queries. Supports PostgreSQL, MySQL, SQLite, keyword case toggling (UPPERCASE vs lowercase), and 1-click .sql file downloads. Runs entirely in your browser.
SELECT u.id, u.name, u.email, count(o.id) AS total_orders FROM users u LEFT JOIN orders o ON u.id = o.user_id WHERE u.status = 'active' AND u.created_at >= '2026-01-01' GROUP BY u.id, u.name, u.email HAVING count(o.id) > 5 ORDER BY total_orders DESC LIMIT 50;
01
How to use
- Paste your raw or minified SQL query into the input editor.
- Select your target SQL dialect (PostgreSQL, MySQL, SQLite, Standard SQL).
- Toggle keyword case (UPPERCASE or lowercase).
- Click 'Format SQL' to produce clean indented SQL, or 'Minify SQL' for single-line strings.
- Copy or download the output as a .sql file.
02
Understanding the output
The formatter parses SQL statements, identifies keywords (SELECT, FROM, WHERE, JOIN, GROUP BY, ORDER BY), and applies standard indentation rules. Minification strips unnecessary whitespace and newlines for embedded queries.
03
Common issues & tips
- •Unclosed string literals or unclosed parentheses can break clause parsing. Ensure SQL statements are complete.
Frequently asked questions
- Is my SQL query uploaded to a server?
- No. Formatting and minification happen 100% locally inside your web browser.