Online Tool Store Online Tool Store

SQL Formatter

Reformat a SQL query with consistent keyword casing, clause line breaks, and indented column lists. Runs entirely in your browser.

🔒 This tool runs entirely in your browser. Your files are never uploaded to a server.

Example shown — replace it with your own query.

 

How it works

  1. Paste a SQL query.
  2. Keywords like SELECT, FROM, WHERE, and JOIN are cased consistently and pushed onto their own lines.
  3. Column lists in SELECT, GROUP BY, ORDER BY, and VALUES are broken one-per-line and indented.
  4. Copy the formatted result.

FAQ

Does this work for INSERT and UPDATE statements too, not just SELECT?

Yes — SELECT, INSERT, UPDATE, and DELETE all get keyword casing and clause line breaks.

Will string literals get mangled?

No — text inside single-quoted string literals (like '2024-01-01') is protected before any whitespace collapsing or keyword casing runs, so values are never altered.

How does it handle deeply nested subqueries?

It formats clauses and comma-separated lists reliably for typical queries, but this is a string-based formatter, not a full SQL parser — very deeply nested or vendor-specific syntax may not indent perfectly.

Is my SQL uploaded anywhere?

No — formatting happens entirely in your browser. Nothing is sent to a server.

How we compare

Feature Online Tool Store Database GUI clients Online upload-and-format sites
No install Requires an app
Query text stays on your device Uploaded to their server
Choice of UPPERCASE or lowercase keywords Varies Varies

For quickly cleaning up a query before pasting it into a PR, a Slack message, or documentation, this beats opening a full database client just to reformat text.

Explore related tools

Embed this tool

Paste this on your own site — it stays free, and every file still stays in your visitor's browser, not yours or ours.