SQL Formatter

How SQL Formatting Works

SQL queries are parsed and re-indented with consistent, readable formatting.

  1. 1

    Tokenize the query

    The SQL input is tokenized into keywords, identifiers, operators, and literals.

  2. 2

    Apply formatting rules

    Indentation, line breaks, and spacing are applied based on the SQL dialect and your preferences.

  3. 3

    Output formatted SQL

    The formatted query is displayed with proper capitalization and consistent style.

FAQ

What SQL dialects are supported?
The formatter supports standard SQL, MySQL, PostgreSQL, T-SQL (SQL Server), PL/SQL (Oracle), MariaDB, SQLite, and BigQuery.
Can I choose keyword casing?
Yes, you can choose to format keywords as UPPER CASE, lower case, or preserve the original casing.
What is SQL minification?
SQL minification removes all unnecessary whitespace and newlines, producing a single-line query suitable for embedding in code or reducing transfer size.

Related Tools