- Developer tools
- SQL Formatter
SQL formatter
Paste a long, single-line query and get readable SQL with consistent indentation and uppercase keywords — or squeeze it back onto one line. Formatting runs on your device, so queries containing real table names and data never leave it.
Free in your browser — no sign-up. Install from the Microsoft Store to use it offline on Windows 10 and 11.
How to use it
- Open the SQL Formatter and paste your query.
- Pick an indent — 2 spaces, 4 spaces or a tab — and press Format.
- Copy the result, or Minify it back to a single line.
Example
select id, name, email from users where active = 1 and created_at > '2025-01-01' order by created_at desc limit 20;SELECT id,
name,
email
FROM users
WHERE active = 1
AND created_at > '2025-01-01'
ORDER BY created_at DESC
LIMIT 20;Features
- Readable layout — each clause on its own line, with columns and conditions indented underneath.
- Uppercase keywords drawn from the common SQL dialects; string literals are left alone.
- Minify — collapse a query to one line for logs, code or config.
- AI Explain and Optimize — optional, with AI credits: get a plain-English explanation, or index and rewrite suggestions.
- Works offline in the Windows app.
Frequently asked questions
Is my SQL sent anywhere?
Formatting and minifying run locally. A query only leaves your device if you click AI Explain or AI Optimize.
Which databases does it support?
It formats standard SQL syntax and recognises keywords used across MySQL, PostgreSQL, SQL Server and SQLite, including MySQL-style backtick identifiers.
Is the SQL formatter free?
Yes. Format and minify are free. Pro adds the SQL INSERT generator, which turns CSV or JSON into batched INSERT statements.
Related tools
One workspace for all of it
SQL Formatter is one of 18 developer tools in CodeForge — alongside a JSON formatter, JWT decoder, regex tester, UUID and hash generators, and more. Press Ctrl+K to jump to any of them.
Free in your browser — no sign-up. Install from the Microsoft Store to use it offline on Windows 10 and 11.