Messy SQL code to aligned, readable, and ready to run
Paste a messy SQL query and get it formatted with clean lines and indentation, ready to run and share with your team. Choose from five dialects: PostgreSQL, MySQL, SQLite, SQL Server, or BigQuery. The tool breaks the query into lines by clauses, indents with two spaces, and capitalizes keywords. The logic remains unchanged, as table names, columns, and values stay exactly as they are. Copy the result or download it as a query.sql file. This is useful before a code review, for reading auto-generated queries, and for documentation. Everything runs in the browser, and your code is never sent to any server.
Five: PostgreSQL, MySQL, SQLite, SQL Server, and BigQuery. You can try formatting Oracle or other dialects using the closest match, but unique syntax might fail.
Only the spaces, line breaks, and keyword capitalization. What the query actually does remains identical.
The parser could not read the query, usually due to syntax from a different dialect or a missing bracket. The English error message indicates where it stopped, and it is worth trying a different dialect.
No. The tool always writes keywords like SELECT and WHERE in uppercase. This is the common convention to distinguish them from table and column names.
No. The formatting is done entirely in your browser, so you can safely paste queries containing internal table names.
Klix could not load
Try reloading the page first. If a new version just went out, a reload fixes it straight away.
If reloading did not help, your browser may be too old. Klix runs the tools on your own device rather than on a server, so it needs a browser from 2022 or later. What to do: update Chrome or Firefox, then open klixtools.com again.