SQL Formatter
100% PrivateDeveloper ToolsFormat SQL queries with uppercase keywords and clean clause layout, for eight dialects.
Runs entirely in your browser. Your input is not uploaded to Ovatly or anywhere else.
- 1Paste your SQL statement into the input box.
- 2Choose the dialect your database uses.
- 3Press Format SQL.
- 4Copy or download the formatted query.
Input: select id, name from users where id = 1 order by name Output: SELECT id, name FROM users WHERE id = 1 ORDER BY name
- Keywords are upper-cased; your identifiers, values and string literals are left exactly as written.
- Pick the right dialect: some syntax, like MySQL backticks or T-SQL brackets, only parses correctly in its own dialect.
- The formatter does not connect to any database and cannot tell you whether the query will run or return rows.
No. It changes layout and keyword case only. The statement your database receives is equivalent.
About this tool
The SQL Formatter lays out queries with keywords in upper case and clauses on their own lines, for eight dialects including PostgreSQL, MySQL and SQL Server. A formatted query is faster to review, easier to diff in code review, and much easier to debug than a one-line string copied out of application code.
Related tools
Part of Ovatly's free tools in Developer Tools.