SQL Formatter
Format and beautify SQL queries with keyword uppercasing.
How to Use the SQL Formatter
Paste your SQL query into the input box, then click "Format" to beautify it with uppercase keywords and proper indentation. Choose between 2-space or 4-space indentation.
What This Tool Does
- Uppercase Keywords — converts SELECT, FROM, WHERE, JOIN and other SQL keywords to uppercase
- Clause Formatting — adds newlines before major clauses for readability
- Subquery Indentation — indents nested subqueries within parentheses
- Configurable Indent — choose between 2 or 4 spaces for indentation depth
The tool runs entirely in your browser using simple regex-based formatting. No data is sent to any server.
Frequently Asked Questions
Does this tool validate my SQL?
No. This tool formats SQL for readability by uppercasing keywords and adding line breaks. It does not check for syntax errors or query correctness.
What SQL dialects are supported?
The formatter works with standard SQL keywords common across MySQL, PostgreSQL, SQLite, SQL Server and Oracle. Dialect-specific syntax will be preserved but may not receive special formatting.
Does my SQL get uploaded anywhere?
No. All formatting happens locally in your browser. Your queries never leave your device.
How are subqueries handled?
Subqueries inside parentheses are automatically indented one level deeper. Nested subqueries receive additional indentation.
More Developer Tools
JSON Formatter
Format, validate and minify JSON with syntax highlighting.
Open tool →Base64 Encode / Decode
Encode text to Base64 or decode Base64 back to text.
Open tool →UUID Generator
Generate UUID v4 identifiers, single or in bulk.
Open tool →Unix Timestamp Converter
Convert Unix timestamps to human-readable dates and back.
Open tool →URL Encode / Decode
Encode or decode URLs and query parameters.
Open tool →HTML Entity Encode / Decode
Encode special characters to HTML entities or decode them back.
Open tool →