SQL Formatter

Developer Tools

Break a one-line query onto keyword lines so you can read it.

Calculated Result
SELECT id, name FROM users WHERE active = 1 ORDER BY name
Formula: Keyword line breaks; dialect-agnostic

About this calculator

Paste a query from logs. Keywords are uppercased. This is not a parser: odd dialects still wrap on the common keyword list.

How It Works & Formula

FormulaKeyword line breaks, dialect-agnostic

Normalize whitespace, then newline before SELECT/FROM/WHERE/JOIN and friends.