How do I format SQL online?
Paste your SQL into Tidysql, pick a dialect, click Format. Clean, readable SQL comes back in under ten seconds, with a side-by-side diff so you can see what changed. No login, no install, nothing leaves your browser. It runs client-side on the sql-formatter v15 engine, with 14 dialects and real controls for keyword case and indentation.
That's the short version. The longer version is why most other free SQL formatters feel like a tax on your day.
The state of free SQL formatters in 2026
Search "sql formatter online" and the top results are tools that earned their rankings years ago and haven't meaningfully changed since. CodeBeautify pulls in around 2.3 million monthly visits with three dialects, an interface from another era, and ad slots that elbow your input panel for space. dpriver supports 24 dialects but its design predates flat UI. The one modern, clean alternative is Aiven's free formatter, which is really a lead-gen funnel for a cloud database platform with no save, share, or export.
So your options today: dated and ad-heavy, dated and configurable, or modern and aimed at signing you up for something else.
Tidysql sits in the gap none of them fill. Modern web formatter, no account, no upsell, and a feature no other web formatter ships: a before/after split diff view that shows you which lines were reformatted.
What Tidysql actually does
Tidysql wraps the sql-formatter v15 engine in a UI built for one job. No panels of unrelated tools, no JSON beautifier hiding in the sidebar, no cookie banner that takes three clicks to dismiss. The input editor is above the fold and the placeholder shows you a sample query.
Twelve features, the entire product:
- Format engine. sql-formatter v15, run client-side. Output appears in under 200 milliseconds.
- Fourteen dialects. PostgreSQL (default), MySQL, T-SQL, BigQuery, SQLite, Snowflake, Redshift, MariaDB, DB2, Hive, Oracle PL/SQL, N1QL, SingleStoreDB, Spark.
- Auto-reformat on dialect change. Switch from PostgreSQL to BigQuery and your output updates without a second click.
- Before/after split diff view. Side by side, original vs formatted, changed lines highlighted. Toggle off when you don't want it.
- Keyword case control. UPPER (default), lower, or Preserve.
- Indentation control. Two spaces (default), four spaces, or tab.
- SQL minify mode. Collapses your query to a single line for scripts, log lines, or config files. Toggle back to format mode to restore.
- Copy to clipboard. Button label flips to "Copied!" for two seconds so you know it worked.
- Download as .sql file. One click, no server round trip.
- Best-effort parse warnings. Send in something half-broken and you still get a usable result, with a non-blocking banner explaining what was off.
- Reserved ad placements that don't shift the layout. Containers are sized at load. Ads fill or stay empty. Your editor doesn't jump.
- PostHog event tracking. So we can tell which dialects and features get used and which to drop.
That's the whole product. No v1.5 hidden behind a paywall.
Why a diff view changes how you use a SQL formatter
Most formatter sessions go like this: paste, click format, scan the output, copy it, paste it somewhere else, then realize you can't quite remember what changed. Did the formatter rewrite your CASE statement? Did it move the JOIN conditions? Did it normalize your CTE indentation in a way your team's style guide will reject?
A diff view answers those questions on the same screen. Original on the left, formatted on the right, changed lines highlighted. If you're reformatting a query for a pull request comment, two seconds tells you whether the formatter did anything you didn't want.
Every desktop SQL tool has this. Almost no web one does. Tidysql ships it as the default view and lets you collapse to output-only when you trust the formatter and just want the result.
What about competitors I already use?
Honest notes on the alternatives.
CodeBeautify. Probably what you've been pasting into. Fast, free, has a save-online feature for shareable links. The trade-offs are real: three dialects, no formatting options beyond the basics, and an ad layout that constantly tries to steal attention from your code. Tidysql gives you fourteen dialects, real controls, the diff view, and a layout where the ads sit in fixed containers instead of floating around your editor.
dpriver. Supports more dialects than Tidysql and has a unique feature for outputting SQL as Java or C# strings. If that specific feature matters to you, dpriver still wins. If you just need to clean up SQL, the dpriver UI will frustrate you.
Aiven SQL Formatter. The closest thing to Tidysql in the modern-UI department, with the same fourteen dialects. The difference is intent. Aiven's formatter exists to introduce you to Aiven's cloud data platform. Tidysql exists to format SQL. No signup wall, no "try our cloud" banner, no email capture. Tidysql also ships the diff view and minify mode. Aiven doesn't.
Redgate SQL Prompt. The gold standard if you live in SQL Server Management Studio and your company will pay $210 per user per year. Doesn't run in VS Code, doesn't handle PostgreSQL or MySQL, isn't a browser tool. Different category.
sql-formatter (the npm package). Tidysql is built on this. If you're comfortable in a terminal, run it directly:
npx sql-formatter -l postgresql my-query.sqlSame engine. You just don't get a UI, a diff, or one-click copy.
Frequently asked questions
How do I format SQL online for free?
Open Tidysql, paste your SQL into the input editor, choose your dialect, click Format. The formatted output appears in the panel on the right. Use Copy to send it to your clipboard or Download to save it as a .sql file.
What's the best free SQL formatter without ads in your face?
Tidysql was built specifically for that complaint. The page reserves fixed slots for ads at load, so the editor never shifts when an ad fills or fails. The ads themselves are non-intrusive display formats, not interstitials or popups.
How do I format a PostgreSQL query online?
PostgreSQL is the default dialect in Tidysql. Paste your query and click Format. The dialect dropdown sits next to the Format button if you want to confirm. Dedicated landing pages exist for each of the fourteen supported dialects at /format/{dialect} if you'd rather bookmark by database.
How do I minify SQL into a single line?
Toggle Minify mode in the options panel. Tidysql collapses your SQL to a single line with normalized whitespace. Toggle Format mode again to restore. This matches the minify behavior of CodeBeautify and dpriver in a less cluttered interface.
Can I see what changed when I format my SQL?
Yes. The before/after diff view is the default. Original on one side, formatted on the other, changed lines highlighted. Click "Output only" to collapse the diff if you don't want it. No other web SQL formatter ships this view.
Does Tidysql support MySQL, BigQuery, and Snowflake?
Yes. Full dialect list: MySQL, PostgreSQL, T-SQL, BigQuery, SQLite, Snowflake, Redshift, MariaDB, DB2, Hive, Oracle PL/SQL, N1QL, SingleStoreDB, Spark. Switching dialects automatically reformats whatever's in your input editor.
Is my SQL sent to a server when I format it?
No. Formatting happens in your browser. The sql-formatter library is loaded as JavaScript and runs locally. Queries don't leave your machine and aren't stored anywhere. PostHog tracks high-level events like "format clicked" and which dialect was selected, not the contents of your SQL.
Try it
Tidysql is live at appcrib.com/tidysql. Paste a query, pick a dialect, click Format. If the diff view earns its place in your workflow, bookmark the dialect-specific page for whichever database you use most.