SQL Formatter

Format pasted SQL in the generic dialect with uppercase keywords. Review indentation before copying the query to your own editor.

Make a generic SQL statement easier to review. The tool applies SQL Formatter’s generic sql dialect and uppercases recognized keywords without connecting to a database.

  • 100% free
  • No registration
  • On your device
  • Modern browser
  1. 1Enter details
  2. 2Adjust options
  3. 3View result
ResultLive

Your input stays on this device for this operation. We don’t upload or store it.

About SQL Formatter

Make a generic SQL statement easier to review. The tool applies SQL Formatter’s generic sql dialect and uppercases recognized keywords without connecting to a database.

Uppercase keywords

Recognized keywords are formatted in uppercase.

Generic SQL

Uses the same generic dialect for each input.

How to use SQL Formatter

  1. 1

    Paste a SQL statement

    Paste a query into Source text.

  2. 2

    Format the query clauses

    Press Process and check the resulting clause layout.

  3. 3

    Validate against your database

    Copy the query and validate it against the intended database separately.

Formats and practical limits

Generic SQL source in, formatted SQL text out.

  • There is no dialect selector. Vendor-specific constructs can format unexpectedly or fail.
  • The 100,000-unit input limit applies. Formatting does not execute a query, inspect a schema or evaluate query cost.

Practical example

Try select id from orders where status = 'open' and inspect SELECT, FROM and WHERE in the result.

Further reading

Frequently Asked Questions

2 answers
Will this connect to my database?

The workspace formats pasted text only.

Can it convert SQL Server syntax to PostgreSQL?

Dialect conversion requires a separate workflow.