ToolJovia
Developer

SQL Formatter

Format SQL queries with a selected dialect and consistent uppercase keywords, without connecting to a database.

✓ Browser-local processing

Loading tool…

How to use SQL Formatter

Make SQL easier to review with indentation and line breaks. Formatting runs locally and never executes a statement or opens a database connection.

  1. Paste a query or SQL script.
  2. Select the dialect used by your database.
  3. Format and review the result before using it.

Good to know

  • Formatting does not execute, optimize, or fully validate a query.
  • Up to 50,000 input characters. Some vendor extensions and template languages are unsupported.
  • Always review changes before running SQL in a database.

Format a PostgreSQL query while retaining its string literal

Paste the query below and choose PostgreSQL. The formatter uppercases recognized keywords and places the selected column, table and condition on separate indented lines. The words select from inside the quoted string remain lowercase because they are data, not SQL keywords. Review changes before database use. Formatting neither connects to a server, checks table or column existence, nor executes SQL. The selected dialect guides parsing and formatting, so use the one matching the source query.

Query with SQL dialect set to PostgreSQL

select name from users where name='select from';

Expected formatted source

SELECT
  name
FROM
  users
WHERE
  name = 'select from';
Try this in the tool

Common questions

Does the formatter need database credentials?

No. It works entirely with the text you provide.

Does uppercase formatting change string values?

Only recognized SQL keywords are uppercased; string literals retain their content.

Keep going with related tools

All developer →