Format SQL for eleven dialects with proper keyword casing, indentation and clause breaks.
Ctrl + Enter to run
Formatting a query is what makes its logic visible: which conditions belong to which branch of a `WHERE`, where a subquery begins and ends, and whether that `OR` is grouped the way you assumed. Most SQL bugs that survive review are precedence mistakes hiding in an unbroken line.
Dialect selection is not cosmetic. Quoted identifiers, string escaping and a great deal of syntax differ between PostgreSQL, MySQL, SQL Server and SQLite, and a formatter assuming the wrong one will either reject valid input or quietly restructure it. Pick the dialect you actually run.