Skip to content
Tooletto

SQL Formatter With Lowercase Keywords

A preset of SQL Formatter

Format queries while keeping keywords lowercase. Uppercase keywords are the older convention, dating from when editors had no syntax highlighting; many modern style guides now prefer lowercase throughout.

  • Files never leave your device
  • Free, no signup
  • No watermarks
  • Works offline once loaded
Loading tool…

How to sql formatter

  1. 1

    Paste your query

    One long line, or something already half-formatted.

  2. 2

    Set your preferences

    Indent size, and whether keywords are uppercased.

  3. 3

    Copy the result

    Ready to paste back into your editor or migration.

Why uppercase keywords became the convention in the first place

Uppercasing SQL keywords dates back to an era when code editors had no syntax highlighting at all, and visually distinguishing `SELECT` and `WHERE` from the table and column names surrounding them required manually typing them in a different case — it was a substitute for the colour-coding a modern editor now provides automatically. With every mainstream editor and IDE now highlighting SQL keywords by colour regardless of how they are typed, that original justification has largely disappeared, and a number of modern style guides have moved to recommending lowercase throughout for a simpler reason: it is faster to type and does not require switching mental gears between cases while writing a query.

Matching whatever a specific team or project has already settled on

The correct case convention for keywords is ultimately whatever a given project's existing codebase or team style guide already uses, not an objectively correct choice — the actual behaviour of the query is identical either way. This preset exists for exactly the teams and individuals who have already settled on lowercase, so a formatted query matches the prevailing style of the surrounding codebase rather than introducing a jarring, differently-cased query into a file where every other query is lowercase.

Consistency matters more than which convention wins

The actual cost of mixed keyword casing within one codebase is not technical — SQL does not care — it is the small, cumulative friction of a reviewer's attention snagging on an inconsistency every time they read a query, which adds up across a team reviewing dozens of queries a week. Picking one convention, lowercase or uppercase, and applying it uniformly is what actually delivers the readability benefit; this preset makes lowercase the mechanical default so nobody has to manually retype keywords to match a team's chosen style.

Frequently asked questions

Will it change what my query does?

No. Only whitespace and keyword capitalisation change — no clause is reordered and no token rewritten. SQL keywords are case-insensitive, so uppercasing them cannot alter behaviour.

What happens to text inside quotes?

It is left exactly as written. The formatter tokenises the query before touching anything, so a string like 'check the order from stock' keeps its lowercase "order" and "from" rather than having them uppercased as keywords. Regex-based formatters get this wrong routinely.

Which SQL dialects work?

The common clause structure shared by PostgreSQL, MySQL, SQL Server, SQLite and Oracle. It formats rather than parses, so dialect-specific syntax passes through untouched instead of causing an error — but it will not be specially indented either.

Are my queries sent anywhere?

No. Formatting happens in your browser. That matters because real queries carry table names, column names and sometimes literal customer data — none of which should be pasted into a stranger's server.