Pretty-print, minify and toggle keyword case. Works with MySQL / Postgres / Oracle / SQL Server.

Switch tool
Placeholders ? / $1 / :name are recognized and preserved.
Input0 chars · 0 lines
Output0 chars · 0 lines

How to use

Purpose

Online SQL formatter that beautifies, minifies, and standardizes SQL across MySQL, PostgreSQL, Oracle PL/SQL, SQL Server T-SQL, SQLite, BigQuery, Snowflake. One click expands single-line queries into readable multi-line structure with SELECT columns aligned, JOINs on their own lines, and subqueries indented. Minify mode condenses for embedding in code or logs. Common in code review, slow query analysis, complex report maintenance, and cleaning up ORM-generated SQL. All processing is local.

Steps

  1. Paste SQL into the editor (single or multiple statements separated by semicolons)
  2. Select dialect: MySQL (default), PostgreSQL, Oracle PL/SQL, SQL Server T-SQL, Snowflake, etc.
  3. Click Format for standard indentation: SELECT columns, FROM tables, WHERE conditions each on their own lines
  4. Click Minify to strip whitespace for code embedding
  5. Keyword case: All-Uppercase (classic), All-Lowercase (modern), or As-Is
  6. Syntax errors (missing commas, unbalanced parens, unclosed quotes) are flagged at position
  7. Multiple statements separated by semicolons are formatted independently
  8. Export as .sql file or copy formatted output for direct paste

FAQ

Why is PL/SQL BEGIN...END block indentation wrong?
Switch dialect to Oracle PL/SQL — that enables the block-aware parser for BEGIN/END, IF/THEN/END IF, LOOP/END LOOP. With MySQL selected, PL/SQL blocks are treated as unrecognized text and kept as-is.
Are complex window functions (OVER PARTITION BY) handled?
Yes. OVER (PARTITION BY ... ORDER BY ... ROWS BETWEEN ...) is split into readable lines with PARTITION BY, ORDER BY, and frame clauses each indented. Essential for analytics SQL.
Do MyBatis placeholders like #{} get broken?
No. The formatter recognizes #{varName}, ${tableName}, :namedParam, and ? — they are preserved verbatim and not parsed as SQL syntax.
Can I format SQL with backticks and MySQL EXPLAIN output?
In MySQL dialect, backticks (`column_name`), double quotes, and comments (-- and /* */) are all recognized. EXPLAIN is a command, not a query, but it is kept in front of the SELECT untouched.
Can I batch-format an entire .sql script?
Yes. Drop a .sql file and the tool splits by semicolons, formats each statement independently, then concatenates. Multi-statement transactions (BEGIN/COMMIT) are preserved as a block.

Use cases

  • Code Review: a teammate submitted a 200-line single-line SQL; format reveals JOIN order and WHERE clauses
  • Slow query analysis: extract slow log SQL, format, then read subqueries and index usage clearly
  • Maintain report SQL: BI tools produce hundreds of lines; periodic formatting keeps the team aligned
  • Clean ORM output: MyBatis/Hibernate often print single-line SQL; format before pasting into tickets
  • Database migration prep: legacy DDL exports are messy; format before version control or diff

Use cases

Daily SQL code review, slow query triage, ORM output cleanup, cross-dialect migration prep. DBA, backend developer, data analyst, report engineer. Multi-dialect parsing, ORM placeholder safety, and configurable keyword case are the differentiators.