SQL Beautifier formats unreadable or compressed SQL into clean, consistently indented code. Choose 2-space, 4-space or tab indentation, control keyword case (UPPER/lower/Title), and see the formatted output instantly. Works entirely in your browser — no upload needed.
Formatted SQL will appear here…About SQL Formatter
SQL Beautifier formats unreadable or compressed SQL into clean, consistently indented code. Choose 2-space, 4-space or tab indentation, control keyword case (UPPER/lower/Title), and see the formatted output instantly. Works entirely in your browser — no upload needed.
Frequently Asked Questions
What is SQL Beautification?
SQL Beautification formats compressed or poorly indented SQL into readable code with consistent indentation, line breaks at each clause (SELECT, FROM, WHERE etc.), and optionally standardized keyword case.
Can I control keyword case?
Yes. Three options: UPPER (SELECT, FROM, WHERE), lower (select, from, where), or Title Case (Select, From, Where). The setting applies to all SQL keywords including JOIN types, aggregate functions, and dialect-specific keywords.
What indent options are available?
2 spaces (default), 4 spaces, or a tab character. The indent is applied to continuation lines after each major clause.
Does it handle CTEs and subqueries?
Yes. Common Table Expressions (WITH clause) and subqueries are detected and formatted with proper line breaks. CASE WHEN THEN ELSE END blocks also get individual line breaks.
Is there a file size limit for .sql files?
You can import .sql and .txt files up to 5MB via the Import File button or by dragging and dropping the file anywhere on the tool.