SQL Formatter
Lay out a long query by clause, in the dialect your database actually speaks.
- Privacy
- This tool runs in your browser. Nothing you enter is sent to Wayfind.
- Filed under
- Filed under
Lay out a long query by clause, in the dialect your database actually speaks.
Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite and SQL Server (Transact-SQL). The dialect decides how identifiers are quoted and which words are keywords, so choosing the right one matters: square brackets quote a name in SQL Server, while backticks do in MySQL and MariaDB.
Unlike the other formatters, this one parses the statement before laying it out. A statement written for another dialect, or one that is genuinely incomplete, is reported instead of being rewritten wrongly. Try another dialect first.
The words, names, strings, numbers and comments are the ones you wrote, in the same order; the line breaks, the spaces and the indentation change. If you ask for it, so does the case of keywords, data types and built-in functions. Which words those are comes from the dialect's list, and a few lists include common column names: in SQL Server, Type and Language count as keywords unless you quote them ([Type]). Keep keywords as written if your database compares names by case.
No. It is formatted in this browser tab, in a background worker, and never leaves your device. That matters for a query: table names and literals often describe real data.