SQL Formatter illustration

SQL Formatter

Formats SQL queries with consistent indentation, keyword casing and line breaks — for PostgreSQL, MySQL, SQLite, BigQuery, T-SQL and more — or compresses them to a single line. Formatting runs locally with the sql-formatter library.

Runs 100% in your browser — nothing you paste leaves your device.

Notes

  • Formatting is purely cosmetic: the query semantics are untouched, and string literals are never modified.
  • Pick the dialect that matches your database so its specific keywords and operators are recognized.
  • Runs 100% in your browser — nothing you paste leaves your device.

Explore the idea

This interactive demo needs JavaScript.