SQL Formatter
Format raw SQL into readable, consistent style: keywords uppercased, clauses on new lines, and clear indentation. Supports common dialects and a parameterized indent size.
Runs 100% in your browserNo signup neededFree forever
Paste a query and choose your dialect plus indent width. SELECT/WHERE/GROUP BY clauses break onto their own lines with aligned keywords so long queries become scannable.
SQL input
Dialect
Style
Formatted
SELECT
u.id,
u.name,
COUNT(o.id) AS orders,
SUM(o.total) AS spent
FROM
users u
INNER JOIN orders o ON o.user_id=u.id
WHERE
u.active=1
AND o.created_at>='2024-01-01'
GROUP BY
u.id,
u.name
HAVING
SUM(o.total)>100
ORDER BY
spent DESC
LIMIT
10;Frequently asked questions
Does formatting change how the query runs?
No — whitespace and case don't affect SQL execution. Formatting only changes readability.
Which SQL dialects are supported?
Standard SQL plus the common flavors: MySQL, PostgreSQL, SQL Server, Oracle and SQLite, selectable from the dropdown.
More tools
JSON Formatter & ValidatorBeautify, minify, validate and explore JSON with a tree view.Base64 Encoder / DecoderEncode and decode Base64 text with full UTF-8 support.Hash GeneratorGenerate MD5, SHA-1, SHA-256 and SHA-512 hashes instantly.Text Diff CheckerCompare two texts side by side with live highlighting.Regex TesterLive pattern matching with highlighted matches and groups.UUID GeneratorBulk generate RFC 4122 UUIDs (v4 & v7) in one click.URL Encoder / DecoderEncode and decode URLs and query parameters cleanly.CSV ⇄ JSONConvert CSV tables to JSON and back, with live preview.JWT DecoderDecode JWTs into header, payload and signature views.Timestamp ConverterConvert Unix timestamps, ISO dates and human dates both ways.Hex ViewerInspect text bytes as an offset, hex, ASCII classic hexdump.Case ConverterConvert text between camelCase, snake_case, kebab-case and more.URL Slug GeneratorTurn any title or phrase into a clean, SEO-friendly URL slug.Lorem Ipsum GeneratorGenerate placeholder text: words, sentences or paragraphs.Password GeneratorGenerate strong random passwords with an entropy estimate.Text StatisticsCount words, characters, lines, sentences and reading time.HTML Entities Encoder / DecoderEncode or decode HTML entities (&, <, &) safely.Color Converter & Contrast CheckerConvert HEX, RGB, HSL and HSV with WCAG contrast ratios.CSS Unit ConverterConvert px ⇄ rem ⇄ em with a configurable root font size.HTML FormatterBeautify messy HTML with clear indentation and tags.CSS MinifierMinify CSS: strip comments, whitespace and shorten colors.YAML ⇄ JSONConvert between YAML and JSON with strict validation.CSV → SQL GeneratorTurn CSV data into CREATE TABLE and INSERT statements.HMAC GeneratorCompute HMAC-MD5, HMAC-SHA1, HMAC-SHA256, HMAC-SHA512.Cron Expression ParserExplain cron schedules like '*/5 * * * *' in plain English.IPv4 Subnet CalculatorCalculate networks, broadcast addresses and host counts for CIDR.