SQL Formatter

Format a cramped SQL query into readable, indented lines, or minify it back down. Runs entirely in your browser.

Result

Processed on your device. This file is never uploaded.

  1. 1Paste your SQL query into the input.
  2. 2Choose Format to indent it, or Minify to collapse it.
  3. 3Copy the result.

Readable queries, faster review

A query written on one line is fine for the machine and hard for a person. Formatting breaks the major clauses onto their own lines and indents the join and filter conditions beneath them, so the shape of the query — what it selects, from where, under which conditions — is legible at a glance. That is where most SQL bugs are caught.

A formatter, not a parser

This tool reflows and re-cases keywords rather than fully parsing the SQL, which is what lets it stay dialect-agnostic and instant. It will not tell you whether the query is valid or optimise it — it makes the query you already have easier to read, entirely on your device.

Frequently asked questions