SQL Formatter
Format SQL queries for readability: keywords are uppercased and major clauses like FROM, WHERE, JOIN and ORDER BY start on new lines. String literals are left untouched. Runs in your browser.
Readable SQL queries
The formatter uppercases SQL reserved words and breaks the query so each major clause,
FROM, WHERE, GROUP BY, ORDER BY and joins, starts on
its own line, with AND/OR conditions indented underneath. Text inside
single-quoted string literals is left untouched, even when it contains words that look like keywords.
Formatting runs entirely in your browser; your query is never uploaded.
What this does
A SQL formatter lays out a query for readability, uppercasing keywords and breaking each major clause onto its own line.
How to use it
- Paste your SQL query.
- Format it.
- Read the laid-out query.
- Copy the result.
How it works
Reserved keywords are uppercased and clauses like FROM, WHERE, JOIN and ORDER BY start new lines, with AND/OR conditions indented. Text inside single-quoted string literals is left untouched.
Example
A one-line SELECT becomes a multi-line query with FROM and WHERE on separate lines.
Sources & methodology
Last updated .
Frequently asked questions
How does the formatter lay out a query?
It uppercases reserved keywords and breaks the query so each major clause (FROM, WHERE, GROUP BY, ORDER BY, joins) begins on its own line, with AND/OR conditions indented.
Will it change values inside my query?
No. Text inside single-quoted string literals is preserved exactly, even if it contains words that look like keywords.
Is my SQL uploaded?
No. Formatting runs entirely in your browser; your query is never sent anywhere.
Related tools
JSON Formatter
Pretty-print, validate and minify JSON, with selectable indentation and optional recursive key sorting. Syntax errors are pinpointed by line and column. Fast and private, all in your browser.
XML Formatter
Pretty-print XML with clean, consistent indentation. Self-closing tags and declarations are preserved, and simple text-only elements stay on one line. Instant and in-browser.
Code Minifier
Minify JavaScript or CSS by stripping comments and unnecessary whitespace, safely preserving strings, template literals and regex. See the size saved instantly, all in your browser.
Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 back to text, with a URL-safe (base64url) option. UTF-8 aware, so emoji and accented characters round-trip perfectly. Runs in your browser.