Example
Input (minified SQL)
SELECT id, name, email FROM users WHERE active = true AND created_at > '2026-01-01' ORDER BY created_at DESC LIMIT 10;
Output (formatted)
SELECT id, name, email FROM users WHERE active = TRUE AND created_at > '2026-01-01' ORDER BY created_at DESC LIMIT 10;
Note
Supports PostgreSQL, MySQL, SQLite, MSSQL, BigQuery, and others. CTEs, window functions, and JOINs all get indented properly.
Usage / FAQ
When to use
- Tidy SQL quickly without firing up DBeaver / DataGrip / MySQL Workbench
- Make SQL readable before pasting into issues, Slack, or Notion
- Break down complex CTEs, subqueries, and JOINs visually
- Normalize keyword casing across dialects (PostgreSQL, MySQL, BigQuery, …)
- Self-review queries before code review
FAQ
- Q.Which SQL dialects are supported?
- A.PostgreSQL, MySQL, SQLite, MSSQL, MariaDB, BigQuery, Snowflake, Redshift, and others. The dialect option changes keyword handling.
- Q.Can formatting fail?
- A.If the SQL has syntax errors, only part of it may be formatted (or the original may pass through). Try a different dialect option, or validate the SQL first.
- Q.Is the query actually executed?
- A.No — this tool only formats. There is no DB connection and no execution. Your SQL never leaves the browser.
Fun facts
SQL traces back to Edgar F. Codd's 1970 paper 'A Relational Model of Data for Large Shared Data Banks' — the mathematical foundation of the relational model. On top of it, IBM's San Jose lab built SEQUEL (System Englishlike QUEry Language) in 1974, later shortened to SQL after a trademark conflict.
Wikipedia — SQL historySQL standards are managed by ANSI/ISO — SQL-86 (the first), SQL-92 (the most influential, where most of 'SQL syntax' was nailed down), then SQL:1999, :2003, :2008, ..., :2023. But every real database (Postgres / MySQL / Oracle) ships its own dialect, so 100% compatibility is a fantasy.
Wikipedia — SQL standardsThe uppercase-keywords convention (`SELECT`, `FROM`, `WHERE`) is a relic of 1970s–80s monochrome terminals — without syntax highlighting, case differences provided visual structure. Modern IDEs colorize everything, but the convention stuck. Lowercase SQL is exactly equivalent — purely an aesthetic choice for readability.
Wikipedia — SQL syntax
Related guides
- How SQL Parsing Works (and Why Injection Is Dangerous)
Inside the SQL pipeline — lexer, parser, AST, query planner, executor. Why concatenated SQL is dangerous, how prepared statements actually neutralize injection, and the parser quirks that distinguish PostgreSQL, MySQL, SQLite.
- How Database Transactions Actually Work
ACID, isolation levels, dirty/phantom reads, write skew, MVCC vs locking, SERIALIZABLE, deadlocks, and the retry-on-serialization-failure pattern explained.
- How Query Planners Actually Work
How a SQL planner turns a query into an execution plan: cost model, statistics, cardinality estimation, scan and join choices, and reading EXPLAIN ANALYZE.
- How SQL Injection Actually Works
Classic UNION-based vs blind vs time-based injection, why string concatenation always loses, how prepared statements actually work at the wire level, why ORMs don't fully save you, and second-order injection through stored data.
- How N+1 Queries Actually Work
The lazy-loading trap that produces 101 SQL queries from one user list, eager loading (JOIN, IN), DataLoader (Facebook's batching pattern), the GraphQL N+1 explosion, and why ORMs make this hidden by default.
Related tools
- JSON Formatter / Validator
Format, validate, and minify JSON strings. Adjust indent and optionally sort keys. Runs entirely in your browser.
- String Case Converter
Convert strings between camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, and Title Case — all six cases shown side-by-side.
- Regex Tester
Test JavaScript regular expressions with live match results. Supports g/i/m/s/u/y flags and capture groups.
- Markdown Preview
Render Markdown to HTML side-by-side. Supports CommonMark + GFM (tables, fenced code, task lists). marked is lazy-loaded.
- HTML → Markdown
Convert HTML into Markdown. Headings, lists, links, code, tables, blockquotes. Uses the browser's DOMParser — accurate, 0 dependency.
- YAML ↔ JSON
Convert between YAML and JSON. Tolerates comments and multiline strings on the YAML side. yaml is lazy-loaded.
- Text Diff
Compare two texts and highlight added/removed lines, words, or characters.
- JSON Diff
Compare two JSON values, with optional key sorting and JSON-aware error messages.
- CSV ↔ JSON
Convert between CSV and JSON. Handles quoted fields, custom delimiters, and header rows.
- XML Formatter
Pretty-print or minify XML with attribute preservation. Handles SOAP, sitemaps, and config files.
- XML ↔ JSON
Convert between XML and JSON with attribute and element handling.
- Smart Paste
Paste any text and get tool recommendations — JSON, JWT, Base64, URL, UUID, Cron, and 9 more types auto-detected.
- Lorem Ipsum
Generate placeholder text in words, sentences, or paragraphs. Classic Lorem Ipsum or randomized.
- JSON Path
Query JSON with JSONPath expressions ($.store.book[*].author etc.) and inspect matches.
- JSON Schema Validator
Validate JSON data against a JSON Schema (Draft 2020-12). Powered by Ajv with format support.
- JSON Schema Generator
Generate a JSON Schema (Draft 2020-12) from a sample JSON. Infer types, required fields, and nested structures automatically.
- HTML Formatter
Beautify or minify HTML with proper indentation, attribute alignment, and configurable wrap.
- CSS Formatter
Beautify or minify CSS with proper indentation. Configurable selector and property style.
- JavaScript Formatter
Beautify or minify JavaScript with brace style and indent options. Powered by js-beautify.
- TOML ↔ JSON
Convert between TOML (Tom's Obvious Minimal Language) and JSON. Used in Cargo.toml, pyproject.toml, etc.
- INI ↔ JSON
Convert INI configuration to JSON and back. Supports sections, comments (; or #), and key=value.
- JSON → TypeScript
Generate TypeScript interfaces from a JSON sample. Nested objects become separate interfaces.
- JS Object → JSON
Convert a JavaScript object literal (unquoted keys, single quotes, trailing commas, comments) into standard JSON. Lenient parser, strict output.
- Slug Generator
Convert text into a URL-safe slug. Configurable separator, lowercase, and accent stripping.
- ASCII Tree
Convert indented text or path list into a box-drawing tree (├── │ └──).
- Diff Patch
Generate a unified diff (-u) patch from two text inputs. Compatible with `git apply` / `patch -p0`.
- Mock Data
Generate fake JSON records and SQL INSERT seed data — names, emails, custom fields, UUIDs, dates, and more. 0 dependency.
- MongoDB Extended JSON
Convert MongoDB Extended JSON (EJSON) between Canonical and Relaxed forms, or strip BSON wrappers to plain JSON. Recognizes 16 wrapper types ($oid/$date/$numberLong/$numberDecimal/$binary/...).
- Kubernetes YAML Visualizer
Paste Kubernetes manifests and see the resource graph — Deployments, Services, Ingresses, ConfigMaps, Secrets, PVCs, and how they connect. yaml is lazy-loaded.
- Docker Compose Visualizer
Paste docker-compose.yml and see services, networks, volumes, and depends_on as an interactive graph. Client-side, lazy-loaded yaml.
- PDF Text Extractor
Extract text from a PDF file — page by page or as a single document. Markdown-friendly output, all client-side.
- PPTX Text Extractor
Extract slide text from a .pptx file — plain / markdown / per-slide. Great for converting decks to markdown. All client-side.
- Regex Railroad Diagram
Visualize your regex as a railroad diagram — trace branches, groups, and quantifiers at a glance, in your browser.
- Word & Character Counter
Count characters (with/without spaces), words, sentences, paragraphs, lines, and bytes in real time — free, in your browser.
- LLM Token Counter
Count LLM tokens and estimate cost — exact for GPT (tiktoken), estimated for Claude/Gemini. Context-limit gauge. All in your browser.