🗄️

SQL Formatter

Format and beautify SQL queries with dialect support: MySQL, PostgreSQL, SQLite, BigQuery, T-SQL. Also minifies SQL. Runs in your browser — no upload.

Developersqlformatbeautifyformatter🔒 Browser-only

📋 How to use SQL Formatter

  1. 1Paste your SQL query (minified or messy) into the input box
  2. 2Choose the SQL dialect: MySQL, PostgreSQL, SQLite, BigQuery, or T-SQL
  3. 3Adjust indentation and keyword case options
  4. 4Click Format SQL and copy the result

Try it now

Examples

Format a SELECT query

Input: "SELECT u.id,u.name FROM users u WHERE u.status='active'"
Output: "SELECT\\n u.id,\\n u.name\\nFROM users u\\nWHERE u.status = 'active'"

Frequently Asked Questions

Is my SQL uploaded?

No. Formatting runs in your browser using the sql-formatter library. Your queries never leave your device.

Which dialects are supported?

Standard SQL, MySQL, PostgreSQL, SQLite, BigQuery (Google), and T-SQL (Microsoft SQL Server).

Can I minify SQL?

Yes — click Minify to remove all whitespace and comments for embedding in code or environment variables.

Related Tools