UTILS.
Private by default
⌗

SQL Formatter

Format SQL by uppercasing keywords and putting clauses on their own lines.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →

Your text and files stay on this device. Nothing is uploaded or saved by this tool.

Try a worked example

Example

Select SQL and format select 'from here' as label from notes. Keywords become uppercase and clauses are indented, while 'from here' keeps its original case and both spaces.

Keep in mind

Choose your database dialect. Formatting does not execute SQL or verify that a query will work in your database. Editing the input or settings clears the previous result. Copy and download always use the latest completed conversion.

About this tool

Paste a query or open a SQL file, select SQL, PostgreSQL, MySQL, SQLite or SQL Server, then choose indentation and keyword case. Format the query to inspect it beside your input. Quoted text and comments are preserved. This tool formats SQL; it does not run queries or validate database semantics.

Input is limited to 5 MiB of UTF-8 text, output to 20 MiB and JSON nesting to 128 levels. Large code, tree and table previews are limited to keep the page responsive; copy and download include the complete result. Processing runs locally in a cancellable background worker, including in the downloaded offline tool.

To keep processing responsive, JSON and CSV accept up to 100,000 values or cells. SQL accepts up to 4,000 tokens and 100 nested levels.

Editing the input or settings clears the previous result. Copy and download always use the latest completed conversion.

Your text and files stay on this device. Nothing is uploaded or saved by this tool.

Frequently asked questions

How do I use this tool?
Paste a query or open a SQL file, select SQL, PostgreSQL, MySQL, SQLite or SQL Server, then choose indentation and keyword case. Format the query to inspect it beside your input. Quoted text and comments are preserved. This tool formats SQL; it does not run queries or validate database semantics.
How does it handle my data?
Choose your database dialect. Formatting does not execute SQL or verify that a query will work in your database. Your text and files stay on this device. Nothing is uploaded or saved by this tool.
Can I use large files or work offline?
Input is limited to 5 MiB of UTF-8 text, output to 20 MiB and JSON nesting to 128 levels. Large code, tree and table previews are limited to keep the page responsive; copy and download include the complete result. Processing runs locally in a cancellable background worker, including in the downloaded offline tool. To keep processing responsive, JSON and CSV accept up to 100,000 values or cells. SQL accepts up to 4,000 tokens and 100 nested levels.

More tools