SQL Formatter

Paste messy SQL, pick a dialect and formatting options, and get a clean, readable query. Runs entirely in your browser.

How to use:

  1. Paste your unformatted SQL query in the input box
  2. Select your target SQL dialect (PostgreSQL, MySQL, SQLite, SQL Server)
  3. Choose keyword case, indentation style, and comma position
  4. Click "Format SQL" to beautify your query
  5. Copy the formatted result with the copy button

Input

Formatted

Formatted SQL will appear here.