Ulvixor

Search tools

Search all of Ulvixor's tools by name or keyword.

SQL Formatter

Paste an unformatted SQL query and get an indented, readable version, with support for several SQL dialects (MySQL, PostgreSQL, SQLite, MariaDB, BigQuery, and SQL Server). All processing happens in your browser with the sql-formatter library.

How it works

  1. Paste or type your SQL query into the input panel.
  2. Choose the SQL dialect that matches your database, since each one has slightly different syntax.
  3. Choose the indentation size (2 or 4 spaces).
  4. The formatted result is generated instantly, with keywords in uppercase and a clear structure by clause.
  5. Copy the result or download it as a .sql file.

Use cases

  • Clean up SQL queries generated by ORMs or tools that output them on a single line.
  • Review and debug complex queries with multiple JOINs, subqueries, or conditions.
  • Prepare readable SQL to share in documentation, code reviews, or tickets.
  • Standardize a team's SQL query style before committing it to the repository.

Use cases

  • Clean up SQL queries generated by ORMs or tools that output them on a single line.
  • Review and debug complex queries with multiple JOINs, subqueries, or conditions.
  • Prepare readable SQL to share in documentation, code reviews, or tickets.
  • Standardize a team's SQL query style before committing it to the repository.

Common mistakes

  • Not choosing the right dialect for your database engine.
    Each engine (MySQL, PostgreSQL, SQL Server, etc.) has its own syntax quirks; picking the right dialect improves how the query is parsed and formatted.
  • Pasting several statements separated by ; expecting each to be formatted in isolation.
    The tool can format multiple statements, but make sure each one ends correctly with ; to avoid unexpected results.
  • Confusing a formatting error with a real database error.
    This tool only analyzes syntax to reformat the text; it doesn't execute the query or verify that tables or columns exist.

Frequently asked questions

No. Formatting happens entirely in your browser using the sql-formatter library, with no connection to any database or external server.

Each database engine (MySQL, PostgreSQL, SQL Server, etc.) has variations in its SQL syntax, such as specific functions, comment styles, or different reserved words. Choosing the right dialect helps the formatter correctly interpret and structure constructs specific to that engine.

If the query can't be parsed (for example, due to unclosed parentheses), the tool catches the error and shows a message instead of failing or returning an incorrect result.

No. It only analyzes the SQL's syntactic structure to reformat it. It doesn't connect to any database, doesn't execute the query, and doesn't verify that the referenced tables or columns exist.

Alternatives

Editor extensions like SQL Formatter for VS Code do something similar inside your IDE. This tool is handy for quickly formatting a query pasted from a log, a chat, or a ticket, with no editor to open.