Data Transform / SQL Formatter

SQL Formatter

Format, beautify, and minify SQL queries with dialect-aware formatting.

Dialect
Indent
Input
Output

Formatted SQL appears here

Tips

Dialects — MySQL, PostgreSQL, PL/SQL, T-SQL, SQLite

Minify — Collapse to single-line for scripts

Uppercase — Auto-uppercase keywords like SELECT

Privacy — All formatting runs in your browser

About SQL Formatter

Format, beautify, and minify SQL queries online with dialect-aware formatting. RAW's SQL Formatter supports standard SQL, MySQL, PostgreSQL, T-SQL, and more. Turn messy one-line queries into properly indented, readable SQL instantly.

How to use

  1. 1Paste your SQL query into the input editor.
  2. 2Select your SQL dialect (Standard, MySQL, PostgreSQL, etc.).
  3. 3Click "Format" to beautify or "Minify" to compress.
  4. 4Copy the formatted SQL to your clipboard.

Frequently Asked Questions

Which SQL dialects are supported?
RAW supports Standard SQL, MySQL, PostgreSQL, MariaDB, T-SQL (SQL Server), PL/SQL (Oracle), Amazon Redshift, Apache Spark, BigQuery, and more.
Does it modify my SQL logic?
No. The formatter only changes whitespace and indentation. Your SQL logic, table names, column names, and all other elements remain exactly the same.
Can it format stored procedures?
Yes. The formatter handles CREATE TABLE, INSERT, UPDATE, DELETE, SELECT with joins, subqueries, CTEs, and stored procedures with proper indentation.