DevToolbox

โ†‘ โ†“ to select ยท Enter to open ยท Esc to close

SQL Formatter

Format SQL for common dialects or compact whitespace outside strings and comments.

How to use the SQL Formatter

Format SQL for common dialects or compact whitespace outside strings and comments.

Steps

  1. Paste a SQL statement into the input area.
  2. Choose the SQL dialect, then select Format or Minify.
  3. Review and copy the result before using it in a database client.

Example: A simple query

SELECT id, name FROM users WHERE active = 1;

Limitations

Formatting changes whitespace and layout, not query meaning or safety. It does not validate a query against a database or protect against SQL injection.