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
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
JSON Formatter
Beautify or minify JSON data. Paste, format, and copy.
String Escape / Unescape
Escape and unescape strings for JSON, HTML, URL, SQL, and more.
Regex Tester
Test regular expressions in real-time and see match results.
Diff Viewer
Compare two texts and visualize differences.
Case Converter
Convert text to UPPER, lower, camelCase, snake_case, Title Case, and more.