SQL Formatter

Format and beautify SQL queries with proper indentation


1. What is SQL?

SQL (Structured Query Language) is a standard language for managing and manipulating relational databases. Proper formatting makes SQL queries more readable and easier to maintain.

2. How does it work?

Paste your SQL query in the input field and click Format SQL. The tool will uppercase keywords, add proper indentation, and organize the query for better readability.

Formatting Features

This tool converts keywords to uppercase, adds line breaks before major clauses, indents nested queries, and formats SELECT column lists with proper spacing.

3. Examples

Simple SELECT query

select id, name, email from users where active = true

Query with JOIN

select u.name, o.total
from users u
join orders o on u.id = o.user_id

Complex query

select id, name
from users
where status = 'active'
  and created_at > '2024-01-01'
order by name

References