Skip to main content
textFrontend

SQL Formatter

Format and beautify SQL queries. Multiple dialects, configurable indent, copy or download output.

Open the toolBuild your ownStateless tool. Works instantly, nothing saved.
sql-formatter.genmb.comOpen in new tab

Format and beautify SQL queries across PostgreSQL, MySQL, SQLite, BigQuery, MS SQL, and Standard dialects. Configurable indent size, uppercase-keywords toggle, and target line length.

When to use it

  • 1Cleaning up a hand-written query before checking it into version control.
  • 2Inspecting a complex generated query in a readable form.
  • 3Reformatting a query in a dialect-specific way for clarity.

How it works

  1. 1

    Paste your query

    Left textarea. Output reformats live as you type.

  2. 2

    Pick a dialect

    Dialect-aware formatting matters for keyword recognition. Pick the one that matches your database.

  3. 3

    Tune the style

    Indent size, uppercase keywords, line length - tweak until it looks right.

Frequently asked

Does it run the query?

No - this is purely a text formatter. Connect a real database client for execution.

Want a tool just like this, but yours?

Every tool on this page was generated by GenMB from a single prompt. Describe yours and ship it to your own subdomain in minutes.

Build with GenMB

Related tools