Developer Tool

    SQL Formatter

    Beautify messy SQL queries with proper indentation and uppercased keywords.

    Back to All Tools

    Input SQL

    Formatted

    SELECT
      id,
      name,
      email
    FROM users u
    INNER
    JOIN orders o ON o.user_id = u.id
    WHERE u.active = true
      AND o.total > 100
    ORDER BY o.created_at desc
    LIMIT 50

    About SQL Formatter

    Reading dense, single-line SQL is painful. This formatter restructures any query — SELECT, INSERT, UPDATE, DELETE, JOINs, CTEs — into a clean, readable layout with uppercase keywords and one clause per line. Works with MySQL, PostgreSQL, SQL Server, SQLite, and Oracle dialects.

    Why Format SQL?

    • Easier code review and pull requests
    • Faster debugging of complex JOINs and WHERE clauses
    • Consistent style across your team
    • Better performance analysis and EXPLAIN reading