FormatIn browser

SQL formatter

A local SQL formatter for SELECT, JOIN, CTE, INSERT and other queries: readable indentation, uppercase keywords, copy and clear with no server upload.

Use cases
SQL queriesJOINs and CTEsMigrationsCode review
Input SQL
characters: 0lines: 0
Result

How it works

The SQL formatter loads a local browser formatter library and rewrites the query with consistent indentation, line breaks and uppercase keywords. The selected dialect helps the parser with common syntax differences, but it does not perform semantic validation or connect to a database.

When to use it

Formatting helps before code review, while reading long SELECT statements with JOINs or CTEs, preparing migrations and inspecting SQL from logs. Use your database or CI for execution plans, column types and table existence checks.

How to use it

  1. 1Paste a SQL query into the editor.
  2. 2Choose a dialect if you need the parser to follow PostgreSQL, MySQL, SQLite or another syntax more closely.
  3. 3Click Format to get readable indentation and uppercase keywords.
  4. 4Copy the result or clear the fields.

Questions

Is SQL sent to a server?

No. Formatting runs in your browser, so the source query and result are not sent to a server.

Does the dialect selector validate SQL for a specific database?

No. The dialect helps the formatter parse common syntax differences, but it is not a replacement for your database parser or semantic validation.

Can the tool change query meaning?

The formatter changes whitespace, line breaks and keyword case. Always test production queries in your own environment before applying them.

Other tools

All tools