SQL Formatter

Paste SQL and pretty-print it in your browser — indentation, uppercase keywords, and a copyable result. Nothing is uploaded.

  • Pretty-print
  • Generic SQL
  • Copy result

Generic SQL pretty-print in this tab. Keywords are uppercased and clauses are indented. Dialect-specific extensions (Postgres, MySQL, SQL Server, SQLite) usually still format. Nothing is uploaded.

Paste a query to pretty-print it with indentation, then copy the result.

A SQL formatter turns a minified or hand-typed query into a readable layout. Paste a statement, and this page splits clauses onto their own lines, indents select lists and join conditions, and uppercases reserved words so SELECT, FROM, and WHERE are easy to scan.

Nested subqueries in parentheses get another indent level. JOIN / ON, AND / OR, and CASE / WHEN follow the same rules. String literals and comments are left alone, so a quoted from does not become a clause.

Everything stays in this tab — no upload, no account. Need random IDs for a fixture? Open the UUID generator. To inspect a token, use the JWT decoder. For a crontab line, try the cron expression generator. Check structured data with the schema markup validator. More utilities live on the Developer and SEO hubs.

How to use the SQL formatter

  1. Paste a query into the SQL box, or load the sample.
  2. Read the pretty-printed output with indented clauses.
  3. Optionally press Format to replace the input with that output.
  4. Copy the formatted SQL into an editor, ticket, or client.
  5. Clear the box when you are done. Nothing is stored.

Frequently asked questions

What is a SQL formatter?

A SQL formatter pretty-prints a query so clauses, joins, and lists are easier to read. Paste SQL, indent SELECT / FROM / WHERE blocks, then copy the formatted statement. This page runs entirely in your browser.

Does this SQL formatter change how my query runs?

No. Formatting only changes whitespace and reserved-word casing. Identifiers, string literals, and comments stay as you pasted them. Run the output in your own database client if you need to confirm behavior.

Which SQL dialects does this formatter support?

Generic SQL is the default. Common PostgreSQL, MySQL, SQL Server, and SQLite queries usually format well. Vendor-only tokens are left as written. There is no dialect picker and no server-side parser.

Is my SQL uploaded to a server?

No. Paste, format, and copy stay in this tab. We do not log, store, or send queries. Use it on confidential statements the same way you would a local editor plugin.

Can I format SELECT, INSERT, UPDATE, and DELETE?

Yes. The formatter recognizes those statements plus JOIN / ON, GROUP BY, ORDER BY, HAVING, LIMIT, UNION, CASE, and nested subqueries in parentheses. Multiple statements separated by semicolons are formatted one after another.

Does the SQL formatter uppercase keywords?

Yes. Reserved words such as SELECT, FROM, and WHERE are written in uppercase. Table names, column names, and quoted identifiers keep the casing you typed.

What happens to comments and string literals?

Line comments (-- …) and block comments (/* … */) are kept. Text inside quotes is not parsed as SQL, so a string like 'from' will not start a FROM clause.

Can I copy the formatted SQL?

Yes. After you paste a query, use Copy on the formatted result, or press Format to replace the input box with the pretty-printed SQL. Clear removes both.