SQL Formatter

Make SQL easier to read. Choose the dialect used by your database.

Up to 200,000 input characters. Output limit: 2,000,000 characters.

Download result

Your input is processed in your browser and is not uploaded to ToolPixels. This tool does not save your input.

How to use it

  1. Paste your input, or load the example.
  2. Choose the options that match your task.
  3. Select Format SQL, then review the result.
  4. Copy the result or download sql-formatter.sql.

Formatting, not query validation

Formatting adjusts whitespace and keyword case without running SQL or connecting to a database. Choose your dialect before formatting quoted identifiers, placeholders or dialect-specific statements. The formatter supports common queries, not every stored procedure or vendor extension. A formatted query can still contain semantic errors.

Related developer tools