Free SQL Formatter

Make your database queries easy to read. Automatically indent and capitalize SQL keywords for better maintainability.

SQL Formatter

Work Steps

Step 1
Enter your age in days, months, and years in the text box.
Step 2
You will see your current age.

Options

Indentation Style
Choose tabs or spaces.
Keyword Case:
Uppercase, lowercase, or capitalized.
Minify
Compress SQL for production use.

Frequently Asked Questions

What is SQL Formatter and what is it used for?

A SQL formatter makes SQL easier to read by adding indentation, line breaks, and consistent capitalization or spacing.

Paste SQL into the formatter and choose the dialect/settings if available, then review the formatted query.

SQL dialects differ, so syntax supported by PostgreSQL, MySQL, SQL Server, Oracle, or another engine may not parse identically.

Formatting should not change query logic, but malformed SQL or parser differences can prevent formatting.

Use it for code reviews, debugging complex queries, documentation, and maintaining a consistent style.

If formatting fails, identify the SQL dialect and check syntax around subqueries, vendor-specific functions, comments, and procedural extensions.