tool hub Tool Hub

SQL Formatter

SQL Formatter — runs in your browser. Inputs are not stored.

Runs in your browser No sign-up Free to use


Basic SQL format

Uppercases main keywords and inserts line breaks. Not a full SQL parser.

How to use

  1. Paste a one-line query or a script fragment into the SQL box.
  2. Press Format to uppercase major keywords and split clauses onto new lines.
  3. Comma-separated lists appear in Result indented two spaces on the next line.
  4. Use Copy result to take the cleaned query.
  5. Reset clears input and result.

Key concepts

The SQL formatter is a readability tool, not a parser that understands every dialect. It uppercases common keywords and wraps lines before clauses. Targets include select, conditions, joins, grouping, ordering, limits, insert/update/delete, and aggregate names. It also wraps before logical keywords such as AND and OR so long WHERE clauses read vertically. Formatting a one-line query from a log saves review time. Consecutive spaces are first collapsed to one, then keywords are found and lines split, so uneven drafts become easier to read.

It does not check syntax, bind variables, or explain plans. A word inside a string literal that matches a keyword may be uppercased, so important scripts are safer in a dedicated formatter or editor plugin. This SQL formatter does not send queries to a server; it only substitutes in the browser. It does not run against a database, so use it as read-only cleanup. Formatting empty input leaves the result empty; check that output is filled before copying.

Example

Paste select * from users where id=1; and press Format: SELECT becomes uppercase, FROM and WHERE start new lines, and the result reads vertically. A select list of comma-separated columns puts each name on the next line indented two spaces. Copy the result and paste it into a database client to run.

Related: JSON formatter · JS/CSS formatter · Cron generator

Frequently asked questions

Does the SQL formatter also check syntax?

No. It only uppercases keywords and wraps lines, and does not error on a bad clause.

Which keywords does the SQL formatter uppercase?

Words on its list: select, from, conditions, joins, grouping, ordering, limits, insert/update/delete, aggregates, logical operators, null, and similar-search keywords.

How do comma-separated columns look in the SQL formatter?

A line break and two-space indent are inserted after each comma so the select list stacks vertically.

Can a word inside a string be uppercased by the SQL formatter?

Yes. Replacement uses word boundaries, so English keywords inside literals can change too.

Are SQL formatter queries sent to a database?

No. They are not executed; cleanup is on-screen only. Run them yourself in a client after copying the result.

Does SQL formatter reset clear only the result?

It clears the input box and the result together. Copy first if you need to keep them.

SQL Formatter cover image
Your input is not sent to the server and disappears when you close the page.

Last reviewed: 2026-09-04