SQL Formatter
Format and beautify SQL queries instantly online. Clean up minified or messy SQL with proper indentation, keyword capitalisation, and clause alignment.
Used 10.4K times today
How to Use SQL Formatter
- 1
Paste your SQL
Copy your raw or minified SQL query and paste it into the input area.
- 2
Select dialect (optional)
Choose your SQL dialect — MySQL, PostgreSQL, T-SQL, or standard SQL — for optimised keyword formatting.
- 3
Format and copy
Click "Format" to produce a readable, properly indented SQL query, then copy it for use in your IDE or documentation.
Frequently Asked Questions
Does it support stored procedures and CTEs?
Which SQL dialects are supported?
Does formatting change query behaviour?
About SQL Formatter
The SQL Formatter transforms messy, one-line, or auto-generated SQL queries into well-structured, readable statements with proper indentation and consistent keyword capitalisation. Readable SQL is easier to debug, review, and maintain — especially in large projects with complex joins, subqueries, and CTEs.
This tool supports multiple SQL dialects including MySQL, PostgreSQL, T-SQL, and Oracle, adapting formatting conventions to match the target database system. It is ideal for formatting queries from ORM output, BI tools, legacy codebases, or when onboarding onto an unfamiliar database schema.
More Developer Tools Tools
JSON Formatter
Format, beautify, and validate JSON instantly. Paste raw JSON and get a clean, indented, human-readable output with syntax error detection.
JSON Minifier
Minify and compress JSON by removing whitespace and comments. Reduce JSON payload size instantly for faster API responses and smaller storage footprint.
JSON to CSV Converter
Convert JSON arrays to CSV format instantly. Transform nested JSON data into spreadsheet-ready CSV files with automatic header detection.
JSON to YAML Converter
Convert JSON to YAML format instantly online. Transform JSON config files, API schemas, and data structures into clean, readable YAML syntax.
Base64 Encoder / Decoder
Encode text or decode Base64 strings instantly online. Convert between plain text and Base64 encoding for data URLs, authentication headers, and API tokens.
URL Encoder / Decoder
Encode or decode URLs and query strings instantly. Convert special characters to percent-encoding and back for safe URL transmission and debugging.
HTML Encoder / Decoder
Encode special characters to HTML entities or decode HTML entities back to plain text. Prevent XSS and display HTML code safely in web pages.
UUID Generator
Generate UUID v1, v4, and v5 universally unique identifiers instantly. Create single or bulk UUIDs for databases, APIs, and distributed systems.