Loading tools
Loading tool
5 dialects, auto-detect, 3 keyword-case modes, browser-only.
SELECT u . id, u . name, COUNT(o . id) AS order_count FROM users u LEFT JOIN orders o ON o . user_id = u . id WHERE u . created_at > '2026-01-01' GROUP BY u . id, u . name ORDER BY order_count DESC LIMIT 10;
A SQL formatter takes a messy one-line query and beautifies it into readable, indented SQL -keywords uppercased, clauses on separate lines, comments preserved. This one supports five dialects (PostgreSQL, MySQL, SQL Server, Oracle, SQLite) with auto-detection from syntax cues like RETURNING, TOP n, ROWNUM, or LIMIT a, b.
Most online formatters are single-dialect and ship 10MB of JS bundled with ads. We tokenize SQL in pure JS, run the formatter in your browser, and never see your queries. Use it for code reviews, debugging ORM-generated SQL, or making auto-generated query strings readable before pasting into a ticket.
Most free formatters lock dialect-specific syntax behind paid tiers. We ship all 5 free.
Your SQL often contains real table names + sensitive data. We never see them. SqlFormat.org sends every query to their server.
No popups, no banner ads, no "sign up for premium" interrupts. Just paste, format, copy.
No "pick dialect first" interrupt. Paste, get the right output, move on.
| Feature | Molixa | SqlFormat.org | DBeaver Format | Prettier-sql |
|---|---|---|---|---|
| Dialects supported | 5 + auto-detect | 5 (pick first) | Many | Many |
| Auto-detect dialect | Yes | No | No | No |
| Free, no signup | Yes | Yes (ads) | Desktop install | npm install |
| Browser-only | Yes | Server-side | Local app | Build step |
| Keyword case modes | 3 | 2 | Yes | Yes |
Yes. Unlimited use, no signup, no daily cap. Formatting runs entirely in your browser. SqlFormat.org is free but ad-supported and ships single-dialect output; we cover 5 dialects with auto-detection.
Five: PostgreSQL, MySQL/MariaDB, SQL Server (T-SQL), Oracle (PL/SQL), and SQLite. The auto-detect mode reads syntax cues (RETURNING, TOP n, ROWNUM, LIMIT a,b, autoincrement) and picks the right dialect for you.
Yes. Three modes: upper (SELECT FROM WHERE), lower (select from where), or preserve (keep what you typed). Industry style guides usually pick upper for visibility in code reviews.
Yes. Paste a 500-character one-liner and the formatter breaks it onto multiple lines at major clauses (SELECT, FROM, WHERE, JOIN, GROUP BY, ORDER BY). Indentation per your spaces setting.
No. The tokenizer and formatter run in your browser via pure JS. Your queries -including the table names, column names, and any literal data -stay on your device. No server, no log.
Yes. Single-line comments (-- like this) and block comments (/* like this */) are kept intact. Comments stay on their own line, attached to the next clause they belong to.
Single SELECT/INSERT/UPDATE/DELETE statements format cleanly. Multi-statement procedural code (BEGIN ... END blocks) formats but indentation inside the block stays flat. We're a query formatter first, procedure beautifier second.
We treat JOIN, INNER JOIN, LEFT JOIN, etc. as new-line keywords. The ON clause is also pushed to its own line. If you prefer the JOIN/ON on one line, paste before the JOIN, format, then re-combine.
Yes. Backticks (`col` in MySQL), square brackets ([col] in SQL Server), double quotes ("col" in PostgreSQL) all pass through unchanged. The tokenizer respects them as identifiers.
Yes. The Copy button gets you the formatted SQL on the clipboard. The Download button saves it as .sql. Both work without round-tripping through any server.
5 dialects, auto-detect, browser-only. Free unlimited.
Open the SQL formatterThe SQL Formatter page is built, reviewed, and maintained by the Molixa team. We use the tool we ship and update the docs when the behavior changes.