Skip to main content

Arrange query layout in standard SQL, PostgreSQL, MySQL, SQLite, T-SQL, or BigQuery. Provides dialect examples and indentation options, only handles text, does not connect to or manipulate a database.

It only organizes typesetting, does not connect to the database, does not execute SQL, and does not guarantee that the query will be valid in your database.

64 / 100,000 characters

Shortcut key: Ctrl/⌘+Enter. Modifying inputs or options clears old results.

Instructions for use

  1. First select the SQL dialect corresponding to the target database.
  2. Paste the query or load the same dialect example, select indent and process.
  3. Copy typesetting results; semantics and performance still need to be verified in your own environment.

Input and output examples

Example input
select id from users where active = true;
Example output
SELECT id FROM users WHERE active = TRUE;

Keyword case and line breaks are subject to the current formatter output; formatting is not query optimization.

FAQ

You may have chosen the wrong dialect, or you may have used a syntax that is not supported by the current parser. Check options such as PostgreSQL and MySQL first.

Calculation basis and reference materials

Use SQL Formatter to organize keywords and indentation by the selected dialect. The tool does not connect to the database, execute statements, or check table names, permissions, or execution plans.

Content check: · About this site and content description

Related tools