← Back to Tools

SQL Formatter

Format and beautify SQL. Pretty print or minify. Supports multiple dialects.

Paste or type SQL
Enter your SQL query. Choose dialect and keyword case, then Format or Minify.

SQL Formatter

Format and beautify SQL queries. Raw SQL is often one long line—hard to read and debug. This SQL formatter adds indentation, line breaks, and consistent keyword casing (UPPER or lower). Also minify SQL to a single line for production. Supports PostgreSQL, MySQL, MariaDB, SQLite, and Transact-SQL.

How to Format SQL

  1. Paste your SQL query (SELECT, INSERT, complex joins, etc.) into the input box.
  2. Select dialect (PostgreSQL, MySQL, etc.) and keyword case (UPPER, lower, preserve).
  3. Click "Format" for pretty print or "Minify" to compress. Copy the result.

When to Use

Read complex queries, prepare SQL for documentation, debug long statements, share formatted code, or minify for deployment. Handles nested subqueries, CTEs, and most SQL syntax. All formatting in your browser.