SQL formatter: format and explain SQL
Paste any SQL. Get it cleaned up and colored, with a plain-English outline of what it does and a red flag when it can wipe out a table.
Free from Darnly. Spot a bug in the app you're building? Darnly hands it to Claude Code, Codex or Cursor in one key.Add to Chrome
What this does
Got JSON back from your database? Turn it into types with the JSON to TypeScript tool.
More free tools
See all 89 tools- JSON to TypeScriptPaste JSON and get TypeScript types and a Zod schema, with optional fields found for you.
- Diff checkerCompare two texts side by side and see every added, removed and changed word. Nothing is uploaded.
- px to rem converterpx to rem and back, live, with the matching Tailwind class and a ruler at real size.
How it works
- Paste your SQL in the box. One query or many, even a messy one-liner your AI agent wrote.
- It’s formatted with colors at the top, and next to it you get a plain-English outline: which tables it reads, how they’re joined, what it filters, and whether it changes data.
- Pick your database (Postgres and Supabase, MySQL or SQLite), keyword case and indent. Then copy the clean SQL, or copy a prompt that asks your AI agent to check it before you run it.
Questions
How do I format SQL?
Paste it in the box. It’s formatted as you type, with each clause on its own line and colors for keywords, names, text and numbers. Click “Copy formatted SQL” to take it back to your editor.
Which databases does it support?
Postgres (which is what Supabase and Neon use), MySQL (also PlanetScale and MariaDB) and SQLite (also Turso and D1). Pick yours so things like ::text, backticks and $1 are read the right way.
Why is there a red warning?
An UPDATE or DELETE without a WHERE changes or deletes every row in the table. So do TRUNCATE, DROP TABLE, and a filter that is always true like WHERE 1=1. The warning shows before you run it, because afterwards only a backup can bring the data back.
What does “what this query does” mean?
For each statement you get a short outline in plain words: the tables it reads, how joins keep or drop rows, the filter, grouping, sorting and limit, and what it adds, changes or deletes. It’s worked out from the text, so treat it as a quick read, not a guarantee.
Can it check SQL my AI agent wrote?
Yes. Paste it in, read the outline, and if anything looks off click “Copy prompt for your AI agent”. The prompt asks it to explain the query and give a safer version when something can wipe out a table.
Is my SQL uploaded?
No. Formatting and the outline both run in your browser, so your queries never leave your computer.