SQL Formatter

Format, beautify, and indent SQL queries with uppercase keywords online free.

  • 100% free
  • Private in browser
  • No signup
  • No watermarks
Samples:

Formatted SQL

1 statement
SELECT u.id, u.name, COUNT(o.id) AS order_count, SUM(o.total) AS total_spent
FROM users u
  LEFT
JOIN orders o
ON u.id = o.user_id
WHERE u.status = "active"
  AND o.created_at >= "2026-01-01"
GROUP BY u.id, u.name
HAVING COUNT(o.id) > 2
ORDER BY total_spent DESC
LIMIT 10;

Rate this tool

Be the first to rate — helps others and improves this page.

About SQL Formatter

SQL Formatter on TheToolss cleans up unformatted, inline, or complex SQL queries across MySQL, PostgreSQL, SQLite, Oracle, and MS SQL Server. It automatically capitalizes standard SQL keywords, splits major clauses (SELECT, FROM, WHERE, JOIN, GROUP BY, ORDER BY) into readable lines, and applies proper indentation. All formatting happens privately in your browser.

How to use SQL Formatter

  1. Paste your SQL query or select a sample query template.
  2. Choose your preferred formatting settings (uppercase keywords, indentation type, minify).
  3. View the formatted SQL output and click Copy to clipboard.

Key features

  • Supports standard ANSI SQL, MySQL, PostgreSQL, SQLite, and SQL Server syntax
  • Automatic capitalization of SQL reserved keywords and clauses
  • Customizable indentation styles: 2 spaces, 4 spaces, or tabs
  • Minify mode to collapse queries onto a single line for scripts
  • 100% private and client-side processing without remote database access

Frequently asked questions

Which SQL dialects are supported?
The formatter handles standard ANSI SQL syntax as well as dialect-specific constructs from MySQL, PostgreSQL, SQLite, MariaDB, Oracle, and Microsoft SQL Server.
Does this tool validate SQL syntax?
This tool focuses on formatting, indentation, and keyword casing. It structures queries visually without executing them against a database.
Can I convert keywords to uppercase automatically?
Yes. Enable the "Uppercase keywords" toggle to transform lowercase keywords (select, where, from, join) into uppercase (SELECT, WHERE, FROM, JOIN).
Does the formatter handle comments in SQL?
Yes. Both single-line comments (-- comment) and block comments (/* comment */) are preserved in the formatted output.
Is my SQL query or database schema safe?
Yes. All query formatting runs entirely within your web browser. No queries or table schemas are ever sent to any remote server.
SQL Formatter & Query Beautifier Free | TheToolss