SQL
Formatter

Format and beautify SQL queries with proper indentation and keyword casing.

Dialect

Indent

Keywords

Style

Formatted SQL

SELECT
  u.id,
  u.name,
  o.total
FROM
  users u
  JOIN orders o ON u.id = o.user_id
WHERE
  o.total > 100
ORDER BY
  o.total DESC

Learn more

What are JOINs, GROUP BY, and SQL dialects - and why does formatting matter?

Was this useful?

Frequently Asked Questions

An SQL formatter reformats SQL queries by applying consistent indentation, capitalization, and line breaks to make the code easier to read and debug. It does not change the logic or behavior of the query.

Common SQL dialects include standard SQL (ANSI SQL), MySQL, PostgreSQL, Microsoft SQL Server (T-SQL), Oracle SQL, and SQLite. Each dialect has its own syntax extensions and reserved words that formatters may need to handle differently.

Uppercase SQL keywords (SELECT, FROM, WHERE) are a widely used convention that improves readability by visually separating commands from table and column names. Most style guides recommend uppercase keywords though the language itself is not case-sensitive.

SQL Formatter - Format & Beautify SQL Online | ToolsCanvas