Illustration of a cramped single-line SQL query expanding into a neatly indented, clause-by-clause query

SQL Formatter

Paste a SQL query and get it back with each clause (SELECT/FROM/WHERE/JOIN/GROUP BY/...) on its own line, columns and conditions broken one per line. Runs entirely in your browser.

This is a keyword-driven reformatter, not a full SQL parser — it doesn't validate the query, and subqueries in parentheses aren't specially re-indented (they're broken with the same rules as top-level SQL, which can look flat for deeply nested queries).


💻 Show API usage examples (cURL)
curl -sS -X POST https://devops.majbase.com/sql-formatter/api -H "Content-Type: application/json" -d '{"sql":"select id, name from users where active = true"}'

Returns {"result": "..."}, or {"error": "..."}.

🤖 Use this API as a Claude Skill

Want an AI agent (Claude Code, claude.ai, or anything else that supports the Agent Skills format) to use this tool for you on request? Download the skill below and add it:

⬇️ Download SKILL.md · View raw