SQL Formatter
Format and beautify SQL queries with support for multiple dialects. Customizable indentation and keyword casing.
Why Format SQL Queries?
Raw SQL queries — especially those generated by ORMs or copied from logs — are often a single long line that's nearly impossible to read. Properly formatted SQL with consistent indentation, keyword casing, and line breaks makes queries easier to understand, debug, and review. Good SQL formatting is essential for code reviews, documentation, and maintaining complex queries across a team.
How to Format SQL
Paste your SQL query into the input panel. The tool supports SELECT, INSERT, UPDATE, DELETE, CREATE, and all standard SQL statements.
Choose your SQL dialect (MySQL, PostgreSQL, SQL Server, SQLite, etc.) and customize indentation and keyword casing preferences.
Click Format to beautify or Minify to compress. Copy the result with one click.