Tools

SQL Formatter

Format and beautify SQL queries with proper indentation.

Indent:
Keywords:

How to Use

Paste your SQL query into the input area and click Format to beautify it with proper indentation and line breaks. Click Minify to compress it into a single line. • Keyword case: Choose between UPPER, lower, or preserve original • Indentation: 2-space or 4-space options • Line breaks at major clauses: SELECT, FROM, WHERE, JOIN, etc. • Automatic indentation inside parentheses All processing happens in your browser — no data is sent to any server.

Example

Input: select u.id,u.name,o.total from users u inner join orders o on u.id=o.user_id where o.total>100 and u.active=true order by o.total desc limit 10; Format result: SELECT u.id, u.name, o.total FROM users u INNER JOIN orders o ON u.id = o.user_id WHERE o.total > 100 AND u.active = TRUE ORDER BY o.total DESC LIMIT 10;

FAQ

What is a SQL formatter?
A SQL formatter is a tool that automatically applies line breaks and indentation to SQL queries based on keywords, improving readability.
Which SQL dialects are supported?
Formatting is based on standard SQL keywords. It works with MySQL, PostgreSQL, SQLite, SQL Server, and most other SQL dialects.
Is my data sent to a server?
No, all processing happens entirely in your browser. Your SQL queries are never transmitted anywhere.

Related Tools