ToolForgeby ForgeSparse

SQL Tools

Format and beautify SQL queries.

SQL input

Formatted SQL

SELECT
  u.id,
  u.name,
  count(o.id) AS orders
FROM
  users u
  LEFT JOIN orders o ON o.user_id = u.id
WHERE
  u.active = TRUE
GROUP BY
  u.id,
  u.name
HAVING
  count(o.id) > 0
ORDER BY
  orders DESC
LIMIT
  10;

Format SQL queries online

SQL Tools takes messy, single-line SQL and turns it into clean, properly indented queries — with support for MySQL, PostgreSQL, SQLite, and more.

Why use this tool

Multiple dialects

Format for Standard SQL, MySQL, PostgreSQL, SQLite, or MariaDB — each with dialect-accurate keyword and syntax handling.

Readable indentation

Clauses like SELECT, FROM, WHERE, JOIN, and GROUP BY are broken onto their own lines with consistent indentation.

Upper-cased keywords

SQL keywords are automatically capitalized for a clean, consistent style across your codebase.

Private and offline

Your queries never leave your browser.

How it works

  1. 1Paste your SQL query into the input box.
  2. 2Select the SQL dialect that matches your database.
  3. 3Copy the formatted query or download it as a .sql file.

Frequently asked questions

Good to know

  • Pick the closest SQL dialect for the most accurate formatting.
  • Keywords (SELECT, FROM, WHERE...) are automatically upper-cased.
  • Runs fully in your browser — nothing is uploaded.