SQL Formatter

Format and beautify SQL queries online for free. This tool supports multiple SQL dialects including MySQL, PostgreSQL, SQL Server, SQLite, MariaDB, and BigQuery. Customize indentation size and keyword casing to match your team's style guide.

Ctrl/Cmd + Enter to format
Formatted SQL will appear here

How to Use This Tool

  1. Paste your SQL query into the input area, or click 'Load Sample' to try an example query.
  2. Select your SQL dialect (MySQL, PostgreSQL, etc.) and preferred indent size from the options bar.
  3. Toggle 'Uppercase Keywords' to automatically capitalize SQL keywords like SELECT, FROM, WHERE.
  4. Click Format or press Ctrl/Cmd+Enter to beautify your SQL. Copy the result with the Copy button.

Related Tools