SQL Formatter
DeveloperFormat, beautify, and minify SQL queries with proper indentation and syntax highlighting. Support for all major databases.
SELECT u.id, u.name, u.email, COUNT(o.id) AS order_countโFROM users u LEFTโJOIN orders o ON u.id = o.user_idโWHERE u.status = 'active'โAND u.created_at > '2024-01-01'โGROUP BY u.id, u.name, u.emailโHAVING COUNT(o.id) > 5โORDER BY order_count DESCโLIMIT 10โOFFSET 0
More about the SQL Formatter
A query minified down to one line for an environment variable or a compact log entry and the same query formatted for a code review need opposite treatment, and getting from one to the other by hand means either manually stripping every line break or manually reintroducing indentation depending on which direction is needed. This tool does both: beautifies a cramped query into properly indented, readable SQL, or minifies a formatted query back down to a single compact line, aware of the quoting conventions that differ between databases, backticks in MySQL, double quotes in PostgreSQL, so identifiers stay correctly quoted either direction. Useful for cleaning up a query before a code review, minifying a formatted query down for a config value or a single-line log entry, or reformatting a query pulled from a different database system without its identifier quoting breaking in the process.
Key features
- Clean interface
- Fast processing
- No signup required
- Works offline