SQL Formatter / Minifier

Format /sql

Format and minify SQL text locally without executing, linting, or validating queries.

Transfer
Local only
Limit
2 MiB input
Paste any SQL text block or drop a .sql file.
Formatted
Formatted SQL will appear here.
Paste SQL. Output follows the selected mode. 1 line 57 B local only

How it works

Format or minify SQL locally without executing anything or assuming a specific backend.

Use it to make a pasted query easier to read or compact before copying it elsewhere.

Example

Format a SELECT with WHERE and ORDER BY clauses onto readable lines.

Notes

  • This tool formats query text only. It does not execute SQL.
  • Formatting is intentionally practical rather than dialect-perfect.
  • Quoted strings are preserved while whitespace and clauses are normalized.

Constraints

  • Formats text without executing or validating against a database schema.
  • Limit: 2 MiB input. Nothing is uploaded or silently truncated.

Common errors

  • Dialect-specific syntax
  • Unclosed quotes
  • Expecting schema validation

When to use it

Use it to make a pasted query easier to read or compact before copying it elsewhere.

Formats: Common SQL statements, Quoted strings, Line and block comments.

Reference

ISO/IEC 9075 — SQL

Substantively reviewed .