Skip to content

sharefun2023/sqlformat.io

Repository files navigation

SQLFormat.io

Free Online SQL Formatter — 15+ Dialects, Client-Side, No Upload

sqlformat.io


Why This Exists

Most online SQL formatters send your queries to their server. That's a problem when you're working with production schemas, business logic, or queries that might contain sensitive patterns.

sqlformat.io runs entirely in your browser. Zero bytes leave your device. You can disconnect your internet after the page loads and keep formatting offline.

What's Included

Tool What It Does
SQL Formatter Format/beautify SQL across 15+ dialects (MySQL, PostgreSQL, SQLite, BigQuery, Snowflake, T-SQL…)
Diff Compare two SQL queries side-by-side, highlighted differences
Minify Compress SQL — strip whitespace and comments for embedding
Validate Syntax-check SQL across dialects
ER Diagram Visualize table relationships as diagrams
SQL to JSON Convert SQL query results or schemas to JSON
Data Generator Generate realistic test data for any schema
Explain Visualizer Turn MySQL EXPLAIN / PostgreSQL EXPLAIN ANALYZE output into a readable tree
Dialect Converter Convert SQL between dialects (MySQL ↔ PostgreSQL, etc.)
Regex Replace Search and replace with regex across SQL files
Escape/Unescape Handle string escaping for SQL, JSON, HTML

Quick Start

# No install needed — just open in any browser
open https://sqlformat.io

# Or clone and run locally
git clone https://github.com/sharefun2023/sqlformat.io.git
cd sqlformat.io
python3 -m http.server 8080 --directory public
# → http://localhost:8080

How It Works

User pastes SQL
       ↓
Web Worker (off main thread)
       ↓
sql-formatter library with dialect config
       ↓
Formatted SQL → rendered with syntax highlighting

All formatting happens inside a Web Worker so the UI stays responsive even on 1000+ line queries.

Tech Stack

  • Vanilla JavaScript — no framework, no build step
  • sql-formatter — formatting engine (50KB gzipped)
  • Web Workers — non-blocking background processing
  • Cloudflare Pages — global edge hosting, free tier

Why Client-Side?

Server-Side Formatters sqlformat.io
Privacy Queries sent to server ❌ Zero bytes leave browser ✅
Offline Needs internet ❌ Works after page load ✅
Speed Round-trip latency ❌ Instant ✅
Limits Rate-limited, API keys ❌ Unlimited, no signup ✅
Cost Paid tiers, quotas ❌ Free forever ✅

License

MIT — LICENSE

Links

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages