SQL Formatter

How to format SQL

  1. Paste SQL into the text field.
  2. Optionally select Standard SQL, PostgreSQL, MySQL, or SQLite, then format it.
  3. Review, copy, or clear the result.

SQL formatting example

Format a one-line SELECT query.

one-line SQL → readable clauses

The result is formatted text; it is not executed or validated against a database.

Use cases

  • Make a long query easier to review.
  • Organize SQL in documentation.
  • Compare formatted query versions.
  • Copy a readable query to another editor.

Tips and limitations

  • It uses sql-formatter in the browser.
  • Available dialects are Standard SQL, PostgreSQL, MySQL, and SQLite; a failed dialect attempt falls back to formatting without a dialect.
  • There are no indentation, keyword-case, upload, download, or declared size controls.
  • It does not execute, validate, optimize, or secure SQL.
  • Incomplete SQL and database-specific syntax can format imperfectly or fail; review the result before production use.

Frequently asked questions

Which dialects are available?

Standard SQL, PostgreSQL, MySQL, and SQLite.

Does it run SQL?

No. It only formats text in the browser.

Can I set indentation?

No such control is exposed.