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.
Who this is for
Fullstack/backend/devops engineers — debug JWT, format JSON/SQL, parse cURL, compute CIDR subnets, draft Mermaid diagrams, write conventional commits… Daily toolkit alongside your terminal and editor.
FAQ
Is my pasted code/token sent anywhere?
No. All TopDev dev tools run 100% client-side — JWT, SQL, JSON, cURL, regex… process in-browser. Disconnect to verify. Safe for internal tokens, production DB queries, API keys.
Does it work offline / install as a PWA?
Tools work offline after the first load. Installable PWA is on the roadmap — for now you can bookmark and use without internet.
Related tools
See all tools →JWT Decoder
Decode JWT tokens — header, payload, claims with readable timestamps.
NEWText Diff
Paste 2 texts → highlight diffs at word/line/char level. Great for diffing AI outputs.
NEWJSON Schema Generator
Generate JSON Schema (Draft-07) from a sample — for LLM structured output and API validation.
NEWJSON Formatter
Format / minify / validate JSON. Sort keys A-Z, custom indent, Ctrl+Enter shortcut.