tidysql

Format SQL in seconds. No login. No install. Just clean code.

Input
select id,name from users where active=true
Output
SELECT id, name FROM users WHERE active = true

What is Tidysql?

A SQL formatter that runs in your browser. You paste in ugly SQL and it gives you back something readable. That's the whole thing.

There's no account and nothing to install. The formatting happens client-side using sql-formatter (the open-source library), so your SQL never touches a server.

How it works

Under the hood, Tidysql uses sql-formatter v15 (MIT licensed). When you hit Format, the library parses your SQL into an AST and rebuilds it with proper indentation and keyword casing for whatever dialect you picked. The whole thing runs synchronously in the browser tab you're looking at.

Formatting doesn't change what the query does. Databases treat whitespace as insignificant, so the formatted version runs identically to the original.

What you can do with it

14 dialects

PostgreSQL, MySQL, BigQuery, Snowflake, T-SQL, and 9 more.

Diff view

See what changed between your input and the formatted output.

Minify

Collapse to a single line for embedding in code or configs.

You can also choose keyword casing (UPPER, lower, or preserve) and indentation style (2 spaces, 4 spaces, or tabs). Pick a dialect from the dropdown and the formatter applies that engine's syntax rules, like backtick identifiers for BigQuery or square brackets for T-SQL.

Supported dialects

PostgreSQL
MySQL
T-SQL (SQL Server)
BigQuery
SQLite
Snowflake
Redshift
MariaDB
DB2
Hive
Oracle PL/SQL
N1QL (Couchbase)
SingleStoreDB
Spark SQL

Who uses it

Mostly people staring at a wall of SQL and wishing it had line breaks. More specifically:

  • Backend engineers pulling queries out of logs or ORM debug output and trying to figure out what went wrong.
  • Data analysts cleaning up queries before dropping them into a wiki or a pull request.
  • DBAs reviewing slow-query logs where everything is crammed onto one line.
  • Students learning SQL who want to see what "properly formatted" actually looks like.

Why “Tidysql”?

“Tidy” + “SQL”. You have messy SQL, you want it tidy. That's the whole name.

Privacy

Your SQL stays in your browser. We don't send it anywhere, log it, or store it. See the privacy policy for the full details.

Built by Infinite Orchard. Powered by sql-formatter v15 (MIT). Questions? Use the Contact Us link in the footer.