New

SQL Formatter

Runs in browser

Format SQL queries with readable indentation and line breaks. Paste SQL and get clean, consistent SQL. Runs entirely in your browser.

SQL Formatter tool

Keywords

Files never leave your browser.

Drag and drop a file here, or tap to select

Formatted SQL
SELECT
  u.id,
  u.name,
  u.email,
  o.total,
  o.created_at
FROM
  users u
  LEFT JOIN orders o ON u.id = o.user_id
WHERE
  u.active = true
  AND o.total > 100
ORDER BY
  o.created_at DESC
LIMIT
  20

How to use

  1. Paste or upload SQL

    Paste SQL or load a .sql file.

  2. Review formatted output

    The output updates as you type.

  3. Copy or download

    Copy the formatted SQL or download it with a .sql extension.

Examples

  • SELECT query

    Multi-line formatting for readability.

    Input
    SELECT id,name FROM users WHERE active=1 ORDER BY id;
    Output
    
    SELECT
      id,
      name
    FROM
      users
    WHERE
      active = 1
    ORDER BY
      id
    ;

Frequently asked questions

Is my SQL sent to a server?
No. Formatting runs locally in your browser.
Which SQL dialects are supported?
Common SQL dialects are supported; formatting may vary slightly by dialect.

You might find these useful too.