Skip to content

Text & Query

SQL Formatter

Format SQL in your browser. Supported dialects are listed on the page; this is not a universal SQL parser.

LocalProcessed locally — your SQL never leaves your browser.

Available actions: copy, clear, paste, download.

Uses sql-formatter in your browser. Formatting does not mean the SQL is valid or executable. Dialects are only those this library supports.

How to use

  1. 1. Paste SQL

    Put the query in the input. Choose the dialect that matches your database. The formatter is loaded only for this page.

  2. 2. Format

    Click Format or press Ctrl+Enter / Cmd+Enter. Output is pretty-printed with 2-space indentation. This does not check that the query is valid or executable.

  3. 3. Copy or download

    Copy the result or download a .sql file. Clear resets the workspace. Nothing is uploaded.

Examples

  • Pretty-print a compact query

    select id,name from users where active=1 becomes a multi-line query with clauses on their own lines. Keyword case is preserved.

  • Pick a dialect

    MySQL, PostgreSQL, SQLite, Transact-SQL, and the other dialects listed in the selector come from the sql-formatter library. This is not a universal SQL parser.

Frequently asked questions

Does formatting SQL mean the query is valid?
No. This tool only rearranges whitespace and keywords. It does not execute SQL and does not guarantee that the query will run.
Which SQL dialects are supported?
Only the dialects provided by sql-formatter, shown in the selector (including Standard SQL, MySQL, PostgreSQL, SQLite, Transact-SQL, and others). Do not assume every vendor dialect works.
Is my SQL sent to a server?
No. The sql-formatter library runs in your browser after it loads for this tool.
  • Text & Query

    Regex Tester

    Test regular expressions against sample text in your browser. Invalid patterns cannot crash the page.

    Open tool