Web Tools
SQL Formatter
Format and minify SQL queries with configurable indentation, keyword uppercasing, and clause-based line breaks. Supports SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, JOINs, subqueries, and CASE expressions. Runs entirely in your browser — your data never leaves your machine.
sql formatter database code-formatter minifier
Published May 28, 2026
All interactive tools run entirely in your browser. Your data never leaves your device.
How It Works
Paste a SQL query and choose between format (pretty-print) or minify mode. The formatter tokenizes the SQL, identifies keywords and clauses, and arranges them with proper indentation and line breaks. Strings, comments, and quoted identifiers are preserved exactly.
Features
- Format mode: clause-based line breaks, indented column lists, keyword alignment
- Minify mode: single-line output, comment removal, whitespace compression
- Keyword uppercasing: toggle automatic keyword capitalization
- Configurable indent: 2 or 4 spaces
- Full SQL support: SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, ALTER, DROP
- JOINs: INNER, LEFT, RIGHT, FULL, CROSS with ON clause handling
- CASE expressions: proper indentation of WHEN/THEN/ELSE/END
- Subqueries: parenthesized queries kept inline
- 6 example queries: simple SELECT, JOIN, INSERT, subquery, CREATE TABLE, CASE
- Private: runs entirely in the browser — no data transmitted
Use Cases
- Formatting messy SQL queries for code reviews
- Minifying SQL for production use or URL parameters
- Standardizing SQL style across a team
- Making complex queries readable for debugging