Skip to main content

SQL Formatter

Format SQL queries with clauses on their own lines.

What does this tool do?

Direct answerSQL Formatter breaks major clauses (SELECT, FROM, WHERE…) onto their own lines with uppercase keywords.
Key factSQL is case-insensitive for keywords; formatting uppercases only recognized clause keywords.
ProcessingRuns locally in your browser; no data is sent to a server.

How to use

  1. Paste a SQL query into the input.
  2. Click Format SQL.
  3. Copy the aligned result.

Example

Input

select id, name, email from users where active = 1

Output

SELECT id
  name,
  email
FROM users
WHERE active = 1

Who is this for?

This tool was built for people who need a fast answer in the browser — no install, no account, no data leaving the device.

Developers formatting API responses or config files, analysts inspecting minified payloads, and students learning structured data formats. If you have ever squinted at a one-line blob hoping to find a missing brace, this page is for you.

Frequently asked questions

Which SQL dialect is supported?

Common clause keywords across PostgreSQL, MySQL, and SQLite are recognized; dialect-specific syntax passes through.

Are string literals uppercased?

Never — literals are extracted before keyword uppercasing and restored untouched.

Does it validate my SQL?

No, it reformats text. Validate by running the formatted query in your database.

More tools in this category