SQL Formatter

The SQL Formatter takes a one-line, mashed-together query and turns it into something a human can read at a glance. Each clause gets its own line, joins line up under each other, commas break cleanly, parentheses indent, and keywords (SELECT, FROM, WHERE, JOIN, etc.) take the case you ask for — UPPER, lower, or Title. Pick the dialect you're working in (Standard, PostgreSQL, MySQL, SQLite, SQL Server), and the formatter handles each dialect's quoting rules (double-quoted, backtick, or bracketed identifiers) without mangling them. Runs entirely in your browser. Your query never leaves the page.

Built by Bob QA by Ben Shipped
Works entirely in your browser. Your SQL never leaves the page — no upload, no logging, no calls to a server.

How to use

  1. 1

    Paste your SQL into the input box. Multi-line, one-line — doesn't matter.

  2. 2

    Pick the keyword case: UPPER (the SQL convention), lower (modern style), or Title (mixed).

  3. 3

    Pick spaces or tabs, and the indent width (2, 4, 6, or 8 — ignored for tabs).

  4. 4

    Pick the dialect that matches your database. The formatter respects each dialect's identifier-quoting rules.

  5. 5

    The formatted output appears below as you type. Hit Copy to grab it.

  6. 6

    Run the same query through the formatter again — it's idempotent. Format. Paste. Format again. Same result.

Frequently asked questions

Ratings & Reviews

Rate this tool

Sign in to rate and review this tool.

Loading reviews…