Skip to main content

SQL Formatter

Format and beautify SQL queries for readability.

sqlformatquery
Read the guide
Shortcuts:⌘ KSearch
Input: 0 lines • Output: 0 lines

Frequently Asked Questions

What SQL dialects does this formatter know about?

It has keyword lists for generic SQL plus MySQL, PostgreSQL, and SQLite. That mostly affects which words it uppercases and where it inserts clause breaks.

Can uppercasing keywords accidentally affect string literals?

Yes, it can. The formatter is regex-driven rather than SQL-parser-aware, so keyword casing is not isolated from quoted text.

Why did comments disappear when I clicked Minify?

Minify strips both -- line comments and /* ... */ block comments, then collapses whitespace to a single-line form.

Can I choose tabs or 4 spaces for indentation?

Yes. The indent dropdown supports 2 spaces, 4 spaces, or tabs.

Does it live-format the SQL while I type?

No. The textareas only update the line counters automatically; formatting and minifying happen only when you press the buttons.

Related Tools