SQL Formatter

Make a long query readable.

SQL Formatter reindents queries with keywords aligned, clauses on their own lines and joins laid out so a long statement becomes readable. It handles common dialect syntax, keeps string literals and comments intact, and can uppercase keywords. Queries stay in your browser.

Loading SQL Formatter…

Runs entirely on your device. No file or text you enter here is uploaded. How to verify it.

How to use SQL Formatter

  1. Paste your query.
  2. Choose indentation and keyword casing.
  3. Copy the formatted SQL.

Questions about SQL Formatter

Which dialects does it understand?
The common keyword set shared by PostgreSQL, MySQL, SQLite, SQL Server and Oracle, plus window functions and CTEs. Dialect-specific extensions are preserved verbatim even where the formatter does not specially indent them.
Does it change my query?
No. Only whitespace, line breaks and optionally keyword capitalisation change. String literals, quoted identifiers and comments are passed through untouched — a formatter that lowercases text inside quotes is a bug generator.
Is it safe to paste a production query?
Nothing is transmitted, so yes as far as this page is concerned. Queries frequently embed table names, schema details and sometimes literal credentials, which is exactly why a client-side formatter is the right kind.
Does it check whether my query is valid?
No. It reindents whatever you paste, including syntax the database will reject. A statement that formats cleanly can still fail to run — only the database itself can tell you that.
Is it safe for a query containing real table names or credentials?
The query is reformatted by JavaScript in your tab and goes nowhere else. That is the reason to prefer a client-side formatter: queries routinely carry schema details and literal values you would not want to paste into someone else's server.
Is SQL Formatter really free, with no limits?
Yes. There is no account, no daily cap, no file-size tier and no watermark, because there is no server cost to recover. The site is funded by clearly disclosed partner recommendations on the Partners page, never by metering the tools.
Are my files or text uploaded when I use SQL Formatter?
No. Everything is processed by JavaScript running in your browser, on your device. You can verify it: open your browser's developer tools, switch to the Network tab, and use the tool. You will see no request carrying your data — because there is nowhere for it to go.