Skip to main content

SQL Formatter

Format or minify SQL queries live with support for multiple dialects.

Free & unlimited
Mode
Dialect
Input SQL

1 lines · 81 chars

Formatted SQL
SELECT
  id,
  name,
  email
FROM
  users
WHERE
  active = 1
ORDER BY
  created_at DESC
LIMIT
  10;

12 lines · 99 chars

All processing happens in your browser. No data is sent to any server.

About this tool

  1. 1

    Paste SQL

    Enter your SQL query in the input area.

  2. 2

    Format

    Click format to pretty-print with proper indentation.

  3. 3

    Copy

    Copy the formatted SQL to your clipboard.

  • Formatted SQL is much easier to debug and review in code reviews.
  • The formatter handles SELECT, INSERT, UPDATE, DELETE, and CREATE statements.
  • Uppercasing keywords (SELECT, FROM, WHERE) is a common SQL style convention.
  • Pretty-print
  • Keyword uppercasing
  • Indent control
  • Multiple dialects
  • Copy to clipboard
  • Format messy SQL queries for readability.
  • Prepare SQL for code reviews and documentation.
  • Clean up auto-generated SQL from ORMs.

Related tools

View all

We use anonymous analytics to improve ToolChamp. No personal data is stored or sold. Privacy Policy