Skip to content
TechSolveTools

SQL Formatter

Format and beautify SQL online for MySQL, PostgreSQL, SQLite, SQL Server, BigQuery, Oracle and more: keyword case, indentation, minify and syntax errors with line numbers.

SQL Formatter

How to use SQL Formatter

  1. 1Paste SQL or open a .sql file.
  2. 2Pick your dialect, keyword case and indent.
  3. 3Copy or download the formatted .sql.

What it does

  • 14 SQL dialects
  • UPPER, lower or keep keyword case
  • 2 / 4 spaces or tabs
  • Minify to compact SQL
  • Syntax errors with line & column

FAQ

Why does the dialect matter?
Each database has its own syntax: backtick identifiers in MySQL, [brackets] and TOP in SQL Server, :: casts and $$ strings in PostgreSQL, STRUCT and backtick table paths in BigQuery. Picking the right dialect lets the formatter understand those parts instead of reporting a syntax error.
Does formatting change what my query does?
No. Only whitespace, line breaks and the case of keywords change. String literals, quoted identifiers and comments are kept exactly. Minify also removes comments (except MySQL /*! */ and optimizer hints).
Is my SQL sent to a server?
No. The formatter runs entirely in your browser, so queries with table names, customer data or credentials never leave your device.

You might also like