SQL Prettify
Format and beautify SQL queries for readability.
Paste a query — minified, single-line, or one a colleague pasted from an ORM log — and get a clean, indented version with each clause on its own line and keywords consistently cased. Joins line up, predicates stack, and large queries become readable.
Common use cases: cleaning up ORM-generated SQL before pasting into a bug report, prepping migrations for code review, formatting analytics queries for documentation, and getting a quick visual sense of how complex a query really is.
Input SQL
Formatted SQL
Frequently asked questions
Which SQL dialect does the formatter assume?
Will formatting change what my query does?
Why are my comments getting moved around?
-- comment onto its own line. Block /* … */ comments inside expressions are preserved in place. If a comment must stay glued to a specific token, prefer the block form.Can I use this on stored procedures or migrations?
CREATE TABLE, ALTER TABLE), DML and procedural blocks all format. For very long migration files, format in chunks if your browser feels sluggish.Does my query leave my browser?
Other Formatters
View all tools →JSON Formatter
Format and validate JSON with syntax highlighting
HTML to Markdown
Convert HTML to Markdown format
Markdown to HTML
Convert Markdown to HTML
YAML to JSON
Convert YAML format to JSON with syntax validation
JSON to YAML
Convert JSON to YAML format for configuration files
CSS Minifier
Minify CSS to reduce file size and improve performance
CSS Beautifier
Format and beautify minified CSS code