How to Format SQL Online
Format and beautify SQL queries instantly. Free SQL formatter with syntax highlighting, indentation, and support for MySQL, PostgreSQL, and SQLite.
Open SQL Formatter →Step-by-Step Guide
Paste your SQL query
Copy your raw SQL — SELECT statements, JOINs, subqueries, or entire stored procedures — and paste it into the input area. The tool handles any SQL dialect.
Click Format
Hit the Format button. The tool adds proper indentation, capitalizes SQL keywords (SELECT, FROM, WHERE), and breaks long lines into readable blocks.
Adjust formatting options
Choose your preferred indent size (2 or 4 spaces), keyword case (uppercase or lowercase), and line break style. Toggle options to match your team's SQL style guide.
Copy the formatted SQL
Copy the clean, readable SQL back into your editor, documentation, or PR review. Everything runs locally in your browser — your queries stay private.
Try It Now — Free
No signup, no download. Runs entirely in your browser.
Open SQL Formatter