Paste a SQL query to format it with uppercase keywords and clean line breaks. Works with SELECT, INSERT, UPDATE, DELETE, and DDL statements.
SQL is case-insensitive for keywords, but uppercasing them (SELECT, FROM, WHERE) is a widespread convention that visually separates SQL structure from table and column names. Each major clause starts on its own line. Conditions after WHERE are indented by two additional spaces. These conventions make complex queries much easier to review and debug.
This formatter handles standard SQL keywords and works with queries from PostgreSQL, MySQL, SQLite, SQL Server, and Oracle. It does not understand dialect-specific syntax like PostgreSQL's :: cast operator or SQL Server's TOP clause placement, but it formats them without breaking the query.
More free utilities you might find useful
Format and indent JSON with 2 spaces, 4 spaces, or tabs.
Data FormatsStrip all whitespace from JSON for minimal size.
Data FormatsCompare two JSON objects and highlight added/removed/changed keys.
Data FormatsConvert JSON documents to clean, indented YAML.
Data FormatsConvert JSON objects to TOML configuration format.
Data FormatsConvert a JSON array of objects to CSV with auto-detected headers.