🗃️
SQL Formatter (MySQL, PostgreSQL, BigQuery…)
Pretty-print SQL across 13 dialects: MySQL, PostgreSQL, SQLite, BigQuery, Snowflake, Redshift, MS SQL, Oracle, DB2… UPPERCASE keywords, custom indent.
Pretty-print SQL with sql-formatter. Supports MySQL, PostgreSQL, SQLite, BigQuery, Snowflake, MS SQL, Oracle... Runs 100% in your browser.
When to format SQL
- Code reviews: 100-line ORM-dumped query on one line — unreadable.
- Slow query debugging: format before
EXPLAINto trace JOINs/WHEREs. - Committing to git: consistent formatting → cleaner diffs.
- Learning SQL: formatted queries are easier to understand.
- Docs / blog posts: paste pretty SQL into markdown.
13 supported dialects
- MySQL / MariaDB: backtick identifiers, LIMIT syntax.
- PostgreSQL: double-quote identifiers, JSON operators (
->,->>). - SQLite: lightweight, used for mobile and local apps.
- BigQuery: dataset.table backticks, ARRAY/STRUCT.
- Snowflake: warehouse.database.schema, FLATTEN.
- Redshift: AWS data warehouse.
- MS SQL Server (T-SQL):
[bracketed]identifiers, TOP. - Oracle PL/SQL: ROWNUM, sequences.
- DB2, Hive, Trino: enterprise databases.
Tips
- UPPERCASE keywords: standard convention (SELECT, FROM, WHERE…) — easier to read, separates keywords from identifiers.
- 2 vs 4 indent: team preference. 2 is common for web dev, 4 for DBAs.
- Minify: collapse SQL to one line — handy when embedding in code (ORM strings, logs).
- Privacy: runs 100% in your browser. Production queries are NOT uploaded.
Related
- JSON Formatter — clean JSON output
- JSON ↔ CSV — export query results
- Regex Tester
- All tools
Related tools
See all tools →NEW
🔐
JWT Decoder
Decode JWT tokens — header, payload, claims with readable timestamps.
NEW🎨
JSON Formatter
Format / minify / validate JSON. Sort keys A-Z, custom indent, Ctrl+Enter shortcut.
NEW🔍
Regex Tester
Test regex live with match highlighting. 7 ready presets including Vietnamese.
NEW🔑
UUID / Hash / Base64 / URL
Bundle: UUID v4, SHA-256/512 hash, Base64 (URL-safe), URL encode.