SQL Formatter

Beautify and format SQL queries with proper indentation, keyword casing, and dialect support. One-click minify and copy.

Home/Tools/SQL Formatter
SQL Input
Formatted SQL

What is SQL Formatting?

SQL formatting adds consistent indentation, line breaks, and keyword casing to SQL queries, making them far easier to read and debug. Production SQL is often minified or auto-generated as a single dense line — a formatter restores the structure instantly.

How to Use This Tool

  1. Paste your SQL into the left panel
  2. Select your SQL dialect (MySQL, PostgreSQL, etc.)
  3. Choose keyword casing: UPPER, lower, or preserve
  4. The query is formatted automatically as you type
  5. Click Minify to compress back to a single line
  6. Click Copy to copy the result to your clipboard

Features

  • Multi-dialect — MySQL, PostgreSQL, SQLite, T-SQL, BigQuery, Standard SQL
  • Keyword casing — UPPER, lower, or preserve original case
  • Minify — compress SQL to a single line for embedding
  • Syntax highlighting — color-coded output via Monaco editor
  • Browser-based — your SQL never leaves your device

FAQ

Which SQL dialects are supported?

MySQL, PostgreSQL, SQLite, T-SQL (SQL Server), BigQuery, and Standard SQL.

What is the difference between formatting and minifying SQL?

Formatting adds indentation and line breaks to make SQL readable for humans. Minifying removes all unnecessary whitespace to create a compact single-line query, useful for embedding in code or logs.

Can I change how keywords are cased?

Yes. Choose between UPPER case (SELECT, FROM, WHERE), lower case, or preserve original casing.

Is my SQL data safe?

Yes. All SQL formatting runs entirely in your browser. Your queries are never sent to any server.