SQLFormatter
FormatterConvertPricingDocsGet Pro
Beautifier · Oracle

Beautify Oracle SQL online

Beautify minified, single-line Oracle SQL into clean, readable, properly indented queries. Turn crushed output from logs, ORMs or dbt into something you can read, diff and review.

1Paste your Oracle query into the editor.
2Press Format — or ⌘↵.
3Copy clean, highlighted SQL.
Open formatter
before
SELECT * FROM(SELECT e.employee_id,e.last_name,e.salary,ROW_NUMBER()OVER(ORDER BY e.salary DESC)rn FROM employees e WHERE e.department_id IN(10,20,30))WHERE rn BETWEEN 1 AND 25 ORDER BY rn;
Oracle
SELECT
  *
FROM
  (
    SELECT
      e.employee_id,
      e.last_name,
      e.salary,
      ROW_NUMBER() OVER (
        ORDER BY
          e.salary DESC
      ) rn
    FROM
      employees e
    WHERE
      e.department_id IN (10, 20, 30)
  )
WHERE
  rn BETWEEN 1 AND 25
ORDER BY
  rn;

Why beautify Oracle?

Oracle's classic top-N pattern — a ROW_NUMBER() subquery wrapped in an outer WHERE on rn — is brutal to read minified. Beautifying breaks the inner query, window function and outer filter onto their own indented lines so the paging logic is obvious.

A readable layout is also the first step before tuning: once the analytic function and predicates are laid out vertically, it's clear what Oracle actually has to sort and scan.

All SQL formatters & beautifiers

Format PostgreSQLBeautify PostgreSQL
Format MySQLBeautify MySQL
Format T-SQLBeautify T-SQL
Format SQLiteBeautify SQLite
Format BigQueryBeautify BigQuery
Format OracleBeautify Oracle
Format SnowflakeBeautify Snowflake
Format RedshiftBeautify Redshift