Code tools

SQL Formatter

Format your document locally. Tool input is processed locally, without uploading it.

Runs locally
Input: up to 1 MB. Output: up to 2 MB. Files stay in your browser.
Guide

Make a SQL (Structured Query Language) statement easier to read. Select the database dialect and indentation to lay out clauses and joins. The query stays in the browser and is never executed against a database.

  1. Add your document

    Paste into Input, choose an example or use Open file. You can also drop one UTF-8 file into Input.

  2. Choose the format

    Select your SQL dialect and preferred indentation.

  3. Read and keep the result

    Output updates automatically. Use the main button to run it again, then Copy output or Download to keep the result.

On mobile, choose Output to read the result. Clear removes both fields.

Indent

  • 2 spaces: use two spaces for each indentation level.
  • 4 spaces: use four spaces for each indentation level.
  • Tab: use a tab character for each indentation level.

Dialect

  • PostgreSQL: format queries written for PostgreSQL databases.
  • MySQL: format queries written for MySQL databases.
  • T-SQL (Transact-SQL): format queries written for Microsoft SQL Server.
  • Choose the language used by your database. Formatting does not execute or validate the query.
Shortcuts
  • Ctrl / Cmd + Enter — Run selected action
  • Ctrl / Cmd + Shift + C — Copy output
  • Ctrl / Cmd + S — Download output
  • ? — Show shortcuts outside text fields

Shortcuts work while focus is in the workspace. Copy and download need valid output.

Common questions
Is my document uploaded?
No. Processing happens in a browser worker. Documents and filenames are not stored or sent to a server.
Which documents are supported?
Choose PostgreSQL, MySQL or T-SQL before formatting. This tool changes layout, not your data. It does not execute SQL or prove a query is valid. Stored procedures and custom delimiters are not supported.
What are the limits?
Up to 1 MB of UTF-8 input and 2 MB of output. Processing stops after five seconds; Cancel stops an active operation. Try a smaller document if a limit is reached.

Was this tool helpful?

Only your rating and optional feedback are sent. Your tool input and output are never included.