Format & beautify SQL queries with syntax highlighting. Supports Standard SQL, MySQL, PostgreSQL, T-SQL, and BigQuery.
The SQL Formatter & Beautifier takes raw, compressed, or hand-written SQL queries and reformats them with consistent indentation, line breaks at clause boundaries, and optional keyword casing. It supports five dialects β Standard SQL, PostgreSQL, MySQL, T-SQL (SQL Server), and BigQuery β so dialect-specific syntax is handled correctly.
Readable SQL is easier to review, debug, and maintain. Because formatting runs entirely in your browser using the open-source sql-formatter library, none of your queries or schema names leave your machine.
The formatter supports Standard SQL, PostgreSQL, MySQL, T-SQL (Microsoft SQL Server / Azure SQL), and Google BigQuery. Each dialect handles specific syntax differences like ILIKE, TOP, backtick identifiers, and window function extensions.
No. The formatter only parses and reformats the text of your query. It does not connect to any database, execute statements, or validate table or column names against a real schema.
Yes. Paste multiple SQL statements separated by semicolons and the formatter will process all of them, inserting proper line breaks and indentation between each statement.