DEVELOPER TOOL

SQL Formatter

Format SQL locally with explicit dialects, indentation and keyword casing, without executing queries.

Runs locallyRuns locally in your browser. Your data is not uploaded.
SQL / local formatting

Input

Output

Choose the dialect used by your database. Queries are never executed.

Formatting is not validation.

Choose Standard SQL, PostgreSQL, MySQL, SQLite or SQL Server (Transact-SQL). The sql-formatter engine rearranges whitespace and keyword casing for readability. It does not establish whether a query is valid, safe or correct. It never connects to a database or executes a statement.

Preserve query data.

Comments, identifiers and quoted string contents are retained by the selected dialect. Placeholder syntax is dialect-specific: PostgreSQL $1, MySQL ?, SQLite :name and Transact-SQL @name are supported. No parameter replacement is configured. Unsupported syntax may fail; verify the result before using it. Keyword casing does not intentionally change strings or identifier names.

Deliberately small settings.

Choose 2 or 4 spaces and uppercase, lowercase or preserved keyword spelling. SELECT, joins, nested queries, CTEs and common data-definition/modification statements are formatted where supported by the engine. Stored-procedure languages and templates are not universally supported. Minification and dialect translation are not included.

Local and bounded.

Input accepts 16 KiB UTF-8 and at most 64 opening parentheses, conservatively counting those in quoted strings and comments too. This resource guard bounds recursion and indentation growth; it is not SQL syntax validation. Output is limited to 128 KiB with a bounded editor preview and full copy/download. Unpaired Unicode surrogates are rejected.

A local worker has a 2-second processing deadline and 5-second startup deadline. Cancel terminates it; edits and navigation discard stale results. SQL and derived output stay in memory and are never uploaded, logged or saved.

Find a tool or category

Tools & categories12 results