Skip to content
dashutils

SQL Formatter

Turn one-line SQL into readable, consistently indented queries. Supports standard SQL, PostgreSQL, MySQL, SQLite, SQL Server, BigQuery and more.

  • Free, no sign-up
  • Runs locally in your browser
Loading tool…

Your files are processed on this device and are never uploaded to a server.

How to use the SQL Formatter

  1. 1

    Paste or type your input.

  2. 2

    Choose the operation and options.

  3. 3

    Copy the output or download it as a file.

Dialects

Choose your database dialect so vendor-specific syntax such as PostgreSQL casts or SQL Server brackets is formatted correctly.

What formatting changes

Keywords are uppercased and each clause (SELECT, FROM, JOIN, WHERE, GROUP BY, ORDER BY) starts on its own line, with column lists and conditions indented beneath them. Long queries copied from logs or ORMs become readable without changing what they do: only whitespace and keyword case are changed, never table names, values or logic.

Choosing the dialect

Databases add their own syntax: PostgreSQL's :: casts and $1 parameters, SQL Server's [square brackets] and TOP, MySQL's backticks, BigQuery's backtick-quoted project.dataset.table names. Picking the matching dialect stops these from being split or mis-indented.

Frequently asked questions

Is my data sent to a server?

No. Everything runs in your browser as you type. Nothing is uploaded or logged, so it is safe to paste API responses, tokens and private text.

Does formatting change my query's results?

No. Only whitespace and the case of keywords change. Identifiers, strings and numbers are left exactly as written.

Is it safe to paste production queries?

Yes. Formatting happens in your browser and nothing is sent anywhere, so queries containing table names or sample values stay private.

Can it fix a broken query?

No, it formats valid SQL. If a query has a syntax error, formatting often makes the problem easier to spot, such as a missing comma between columns.

Something not working, or missing a setting you need? Report a problem or request a tool.