DEVtoy
Language · English

SQL Formatter

Format SQL queries for SQL, PostgreSQL, MySQL or SQLite. Control keyword case and indentation.

How to use

  1. Paste your input or load the example below.
  2. Adjust the options, then select “Format SQL”.
  3. Review the result, then copy or download it.

No uploads. No account. Processing stays in your browser.

Example input
select c.id,c.name,count(o.id) as order_count,sum(o.total) as revenue from customers c left join orders o on o.customer_id=c.id where o.status='paid' and o.created_at>='2026-01-01' group by c.id,c.name having sum(o.total)>100 order by revenue desc limit 20

Related tools