Skip to content

SQL formatter and minifier

FormatExperimentalLimited support. Verify anything critical.

SQL formatting turns compressed or inconsistently indented queries into a readable structure with normalized keyword casing, while minification removes comments and nonessential spacing for transport or embedding. This browser-local tool supports common SQL dialect choices and loads its formatter only after you run it. The minifier respects quoted strings and identifiers, but generated output should still be tested against the target database because dialect grammars and vendor extensions differ.

Skip to the tool

This tool processes the values or files you choose on your device. They are not uploaded.

Output

Limits

  • Input is limited to 500000 characters
  • formatting covers the listed SQL dialects.

Warnings

  • Formatting does not validate query semantics
  • minification removes comments.

How to use SQL formatter and minifier

Formatting for review

Readable clauses make joins, predicates, grouping, and ordering easier to inspect during code review. Choose the dialect closest to the system that will execute the query.

Minifying for transport

Minification is useful for fixtures and embedded strings, not database performance; database engines parse equivalent whitespace before planning a query.

How it works

  1. Enter what you haveType or pick your SQL. Nothing is submitted anywhere.
  2. It runs in this tabThe calculation happens on your device, using your browser's own data.
  3. Take the resultRead the formatted SQL, minified SQL, then copy, download, or share a link.

Formatting uses the MIT-licensed sql-formatter package; minification is implemented locally.

Basis
ported-mit
Licence
MIT
Last reviewed

Frequently asked questions

Does formatting change what a query does?

It is intended to change presentation only, but vendor-specific syntax should be verified with the destination database before execution.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close