SQL Formatter

Drop a one-line query into the SQL box (the sample starts as select id,name from users where active=1 order by name), then click Format. The tool collapses extra spaces, uppercases clauses like SELECT and WHERE, starts each major keyword on its own line, and indents items after commas.

Updated 2026-08-04 · Developer

Click Format.

About this tool

This is a lightweight readability helper, not a full SQL parser. It pattern-matches common keywords, normalizes whitespace, and rewrites commas so column lists stack neatly. Invalid or empty input shows Enter SQL until you provide text.

How to use

  1. Open the formatter: Load the page and locate the SQL textarea and Format button.
  2. Paste your query: Replace the sample with the SQL you want to reformat.
  3. Click Format: Press Format to collapse spaces, uppercase keywords, and break lines.
  4. Copy the output: Select the formatted block in the result area and paste it where needed.

Common use cases

Tips

FAQ

Does this validate SQL syntax?

No. It only rewrites spacing and keyword casing for readability.

Which keywords get their own line?

Common clauses such as SELECT, FROM, WHERE, JOIN, GROUP BY, and ORDER BY.

What happens to commas?

Each comma becomes a line break followed by two spaces for list items.

Is my query sent to a server?

Formatting runs locally in the browser when you click Format.

Related keywords

Related tools