SQL Formatter
Format, minify and highlight SQL queries. Supports SELECT, INSERT, UPDATE, DELETE, CREATE, CTEs, window functions, and subqueries.
About SQL Formatting
SQL formatting transforms dense, single-line queries into a structured, readable layout with proper indentation, consistent casing, and logical line breaks. This makes complex queries easier to understand, debug, and maintain — especially for queries with multiple JOINs, subqueries, or CTEs.
This formatter tokenizes SQL into keywords, identifiers, strings, numbers, operators, and comments, then applies indentation rules: major clauses (SELECT, FROM, WHERE, JOIN) start on new lines at the base level, while column lists and conditions are indented. Keywords and functions are automatically uppercased.
The query analyzer detects the statement type, referenced tables, number of JOINs, subqueries, and WHERE conditions — useful for quick complexity assessment of unfamiliar queries.
No SQL is transmitted to any server.