SQL Formatter

Format SQL queries for common database dialects.

Data & Formats
Preparing your workspace…
Input
Output
Your result will appear here.

How to use

  1. Paste your data or open a UTF-8 text file; try the sample to see the expected input.
  2. Choose the options and run the tool, or enable automatic conversion.
  3. Review the result, then copy the selection, copy everything or download a file.

SQL Formatter

Format SQL queries for common database dialects.

Comparison, parsing and formatting run in your browser. Your input is not sent to DevToolsy.

How it works

Choose SQL, PostgreSQL, MySQL, MariaDB, SQLite, Transact-SQL, BigQuery or Snowflake. Adjust indentation and keyword case while keeping SQL strings and comments intact.

Before and after
Input
select id,name from users where active=true order by name;
Result
SELECT
  id,
  name
FROM
  users
WHERE
  active = TRUE
ORDER BY
  name;

Format SQL queries for common database dialects.

Options and data fidelity

Formatting does not run queries or prove that a statement is valid for your database. Select the matching dialect when the parser reports unsupported syntax.

Working with the result

Files are read as UTF-8 text. The editors provide search, selection copying and keyboard shortcuts. Results can be copied or downloaded; changing the input invalidates the previous result.

Processing limits

UTF-8 input up to 1 MiB per document; output up to 8 MiB. Tasks run in a local worker with a 30-second time limit.

Further readingSQL Formatter
?

Frequently asked questions

Which SQL dialects are supported?

Choose SQL, PostgreSQL, MySQL, MariaDB, SQLite, Transact-SQL, BigQuery or Snowflake. Adjust indentation and keyword case while keeping SQL strings and comments intact.

Does formatting execute or validate SQL?

Formatting does not run queries or prove that a statement is valid for your database. Select the matching dialect when the parser reports unsupported syntax.

Is my input uploaded?

No. Comparison, parsing and formatting run in your browser. Your input is not sent to DevToolsy.

Can I open a local file?

Yes. Open a UTF-8 text file of up to 1 MiB. Each comparison input has its own file picker.

Can I copy only part of the result?

Yes. Select text in an editor and use Copy selection, or use the standard keyboard shortcut.

Find your next tool

Language

Switch language? Your current work will be cleared. Copy or download it first.