Developer tool / 20
SQL Formatter
Format SQL for standard, PostgreSQL, MySQL, SQLite, or BigQuery dialects.
SQL Formatter: TOEA tokenizes the selected SQL dialect, applies consistent indentation, and uppercases recognized keywords. Runs 100% locally in your browser with zero server file uploads.
- Category
- Developer tools
- Runs
- In your browser
- Cost
- Free · no sign-up
- Availability
- Ready to use
Runs entirely in your browser
Picking the dialect
The dialect decides how quotes and placeholders are read. MySQL and BigQuery quote identifiers with backticks, while PostgreSQL and standard SQL use double quotes. Placeholders differ too: $1 in PostgreSQL, ? in MySQL and SQLite, and @name in BigQuery. Pick the database the query runs on, since a placeholder or quote the dialect does not know can stop formatting.
Only keywords are uppercased. Table and column names keep their case, which matters in PostgreSQL, where quoted names are case-sensitive.
When formatting fails
A parse error usually means the text is not pure SQL. Templates from dbt, Jinja, or an ORM, like {{ ref('orders') }} or {% if %}, stop the parser at that point; format the compiled SQL instead, or replace the template parts with placeholder names first.
Consistent formatting pays off in code review: when every query is laid out the same way, the diff checker shows real changes rather than whitespace.
How to use it
- Paste SQL and choose a dialect.
- Format the statement.
- Copy or download the readable result.
Privacy & limitations
Queries stay in your browser. Formatting does not validate database schema, permissions, or query performance.
Related tools
Frequently asked questions
Does it execute SQL?
No. It only formats text and never connects to a database.
Why choose a dialect?
Databases differ in keywords, quoting, functions, and syntax, so the dialect improves tokenization.
Free tool · runs in your browser · no account required