How to Format (or Minify) SQL Queries

Published September 13, 2026 · 2 min read

A long SQL query written as one dense line is hard to review or debug. This tool puts each clause on its own line, indents conditions, and breaks up long column lists — or, in the other direction, compresses a formatted query down to a single compact line.

Try SQL Formatter

Steps

  1. 1

    Open the SQL Formatter tool

    Go to the SQL formatter.

  2. 2

    Paste your SQL query

    Paste the query you want to format or minify.

  3. 3

    Choose format or minify mode

    Format for readability with each clause on its own line, or minify to collapse it to one line.

  4. 4

    Copy the result

    Use the formatted or minified query wherever you need it.

Frequently asked questions

Because both directions run instantly in your browser, you can go from a dense query to a readable one and back again in seconds.

← Back to blog