DeveloperFreeNo signupBrowser-only
SQL Formatter & Beautifier
A free online SQL formatter and beautifier. Paste any SQL query and instantly get it formatted with proper indentation, keyword casing (UPPERCASE or lowercase), and syntax highlighting. Supports SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, JOINs, subqueries, and CTEs. Pure browser-based — your queries never leave your machine.
<span style="color:#c084fc">SELECT</span> u.id ,
u.name ,
u.email ,
<span style="color:#c084fc">COUNT</span> (o.id )<span style="color:#c084fc">AS</span> total_orders ,
<span style="color:#c084fc">SUM</span> (o.amount )<span style="color:#c084fc">AS</span> total_spent
<span style="color:#c084fc">FROM</span> users u
<span style="color:#c084fc">INNER</span> <span style="color:#c084fc">JOIN</span> orders o
<span style="color:#c084fc">ON</span> u.id = o.user_id
<span style="color:#c084fc">WHERE</span> u.created_at >= <span style="color:#86efac">'<span style="color:#fbbf24">2024</span>-<span style="color:#fbbf24">01</span>-<span style="color:#fbbf24">01</span>'</span>
<span style="color:#c084fc">AND</span> u.is_active = <span style="color:#fbbf24">1</span>
<span style="color:#c084fc">GROUP BY</span> u.id ,
u.name ,
u.email
<span style="color:#c084fc">HAVING</span> total_orders > <span style="color:#fbbf24">5</span>
<span style="color:#c084fc">ORDER BY</span> total_spent DESC
<span style="color:#c084fc">LIMIT</span> <span style="color:#fbbf24">100</span>
Need a full SQL IDE?
Try DBeaver free →More Developer Tools
Browse all Developer tools →