SQL Formatter

Format and minify common SQL queries in your browser.

The SQL tool quickly organizes SELECT, JOIN, WHERE, GROUP BY, and ORDER BY queries.

Loading...

Examples and limits

This is a lightweight lexical formatter. It does not connect to a database or validate a specific SQL dialect. Input stays in the browser.

Usage

  • Format breaks clauses and logical conditions onto separate lines.
  • Minify removes unnecessary whitespace.
  • Strings, quoted identifiers, parameter placeholders, and comments are preserved, including the newline after a line comment.
  • Unclosed quotes or comments and unsupported characters produce an error instead of being silently discarded. Database semantics are not validated.
Licensed under CC BY-NC-SA 4.0

Report a problem

The links prefill this page's title and address. Add what happened and how to reproduce it.