FreeOnlineQR

SQL Formatter

Take a query that arrived as one 400-character line and lay it out so you can read the logic. Each major clause — SELECT, FROM, JOIN, WHERE, GROUP BY — starts a new line, and the AND, OR and ON conditions are indented beneath the clause they belong to, which is where a query's actual complexity lives. String literals and quoted identifiers are copied through untouched, so a keyword inside quotes stays exactly as you typed it.

SELECT rather than select. Purely cosmetic — SQL keywords aren't case sensitive.

Splits a long SELECT list so each column sits on its own line.

Result

Nothing is uploaded — this tool runs inside your browser, so your files never leave your device.

Help us improve

Why use this tool

  • Each major clause on its own line, with AND, OR and ON indented under it
  • Optional keyword uppercasing, and one-column-per-line for wide SELECT lists
  • Function calls stay tight — COUNT(id), not COUNT (id)
  • Strings, comments and quoted identifiers are never rewritten

How it works

  1. 1Paste the query, however it arrived.
  2. 2Choose whether you want keywords uppercased and columns split onto their own lines.
  3. 3Copy the formatted query into your editor or ticket.

SQL Formatter — frequently asked questions

No. SQL treats whitespace between tokens as insignificant, and the only other change offered — uppercasing keywords — is cosmetic, since SQL keywords aren't case sensitive. String literals, and identifiers inside double quotes or backticks, are left byte for byte as written, so nothing inside them is touched.

Explore the other tools

Same deal everywhere on the site — free, no sign-up, and no watermark on anything you download.

Or see every tool on one page.