Digital ToolPad.

Runs 100% in your browser

Your data never leaves your device. zero uploads.

SQL Formatter

Format SQL queries with selectable dialect and indentation settings in your browser.

Formatting options

367 B

Formatted SQL

391 B
SELECT
  o.id,
  o.created_at,
  c.email,
  p.name AS product,
  oi.quantity * oi.unit_price AS line_total
FROM
  orders o
  INNER JOIN customers c ON c.id = o.customer_id
  LEFT JOIN order_items oi ON oi.order_id = o.id
  LEFT JOIN products p ON p.id = oi.product_id
WHERE
  o.created_at BETWEEN '2026-09-01' AND '2026-09-30'
  AND c.email LIKE '%@example.com'
ORDER BY
  o.created_at DESC;

Parsed as Standard SQLOnly whitespace and letter case changed. Comments are kept unless you remove them.

Formatted in your browser. Nothing is sent to a server.

Query checks

No issues found

Besides syntax errors, the formatter looks for four mistakes that still run: UPDATE or DELETE without WHERE, = NULL comparisons, and an extra comma before FROM or a closing parenthesis.

Fill placeholders from logs

Turn ?, $1, :name or @name into real values. Paste a JSON array or object (strings are quoted for you), or one value per line.

Working with SQL Formatter

Make a dense query easier to review by organizing clauses and nested expressions. Select the dialect that matches the source so the formatter can parse its syntax, such as PostgreSQL casts or SQL Server bracketed names. Comments and string literals are kept as written. Review the result alongside the original query before replacing it.

How to use SQL Formatter

  1. Paste a SQL statement and choose the dialect your database uses.
  2. Adjust keyword casing, indentation and blank lines between statements.
  3. Review the formatted output, which updates as you type, before copying it.

SQL Formatter example

Format a SELECT statement with a JOIN and WHERE clause to inspect its structure more comfortably.

What to expect from the result

Formatting does not execute SQL, optimize its query plan, or prove correctness. An error appears only when the query cannot be parsed for the selected dialect, so a query that formats cleanly can still fail in your database.

SQL Formatter questions

How do I use SQL Formatter?

Paste a SQL statement into the input editor and the formatted version appears in the output panel as you type. Choose the dialect your database uses, then adjust keyword casing, indentation and blank lines between statements before copying the result.

What should I check in the result?

Check that the dialect setting matches your database, because a mismatch can cause a parse error or leave some keywords and function names in their original case. Formatting does not execute SQL or prove correctness, so a query that formats cleanly can still fail in your database.

100% private: your data never leaves your browser

No registration, no tracking of your content, no server uploads. Don't just take our word for it:

  • No server, no uploads

    Your files and text are processed entirely on your device. Nothing is ever sent to us.

  • Works offline

    Once loaded, this tool keeps working with your Wi-Fi turned off. Try it.

  • Verify it yourself

    Open your browser's DevTools → Network tab. You'll see zero requests carrying your data.

Explore more tools

More utilities for your next task.

Browse all tools