SQL formatter
Format and indent SQL for standard SQL, MySQL, PostgreSQL, and SQLite in your browser without uploading anything.
SQL you enter never leaves this device.
How to use it
- 1
Paste your SQL
Put the query into the input box. It can be a single statement or several statements separated by semicolons.
- 2
Choose a dialect
Pick Standard SQL, MySQL, PostgreSQL, or SQLite. The dialect decides how things like backtick names, $1 parameters, and :: casts are read. If your database is not listed, Standard SQL often works for ordinary queries.
- 3
Press Format
The formatted SQL appears in the result box with each clause on its own line. The first press may take a moment because the formatter loads then. Keywords are kept in the letter case you typed, and the indent is two spaces. Formatting changes only spaces and line breaks. The words, names, and values of the query stay as you typed them.
- 4
Copy the result
Press Copy to place the formatted text on your clipboard, then paste it into your editor, a code review, or a document.