SQL Formatter & Beautifier
Format and beautify SQL queries with proper indentation and uppercase keywords. Supports SELECT, INSERT, UPDATE, DELETE, CREATE, and more.
Input Paste SQL here
Formatted Output
About SQL Formatter
This free online SQL formatter transforms messy, single-line SQL queries into clean, readable code with proper indentation. It handles common SQL dialects including MySQL, PostgreSQL, SQLite, and SQL Server syntax.
Features
- Automatic keyword uppercasing (SELECT, FROM, WHERE, JOIN, etc.)
- Configurable indentation (2 spaces, 4 spaces, or tabs)
- Handles subqueries, CTEs, CASE expressions, and nested logic
- One-click minification to compress SQL into a single line