SQLFormatter
FormatterConvertPricingDocsGet Pro
Formatter & beautifier · Oracle

Format & beautify Oracle SQL online

Format and beautify Oracle SQL: consistent indentation, aligned clauses, uppercase keywords — and minified one-liners expanded back into readable code.

1Paste your Oracle query into the editor.
2Press Format — or ⌘↵.
3Copy clean, highlighted SQL.
Open formatter
before
select e.employee_id,e.first_name||' '||e.last_name as name,nvl(e.commission_pct,0) comm,to_char(e.hire_date,'YYYY-MM') hired from employees e where e.department_id=10 and rownum<=20 order by e.hire_date desc;
Oracle
SELECT
  e.employee_id,
  e.first_name || ' ' || e.last_name AS NAME,
  nvl(e.commission_pct, 0) comm,
  to_char(e.hire_date, 'YYYY-MM') hired
FROM
  employees e
WHERE
  e.department_id = 10
  AND rownum <= 20
ORDER BY
  e.hire_date DESC;

Why format Oracle?

Oracle (PL/SQL) has a dialect all its own: ROWNUM paging instead of LIMIT, NVL/DECODE, the || concatenation operator, TO_CHAR/TO_DATE and dual. The formatter parses against Oracle's grammar so these constructs and (+) outer-join syntax stay intact instead of being mangled.

Especially handy for the dense queries copied out of SQL Developer or Toad, where everything lands on one line and ROWNUM logic is easy to misread.

Beautify minified Oracle SQL

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.

minified
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 · beautified
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;

Frequently asked questions

Does the formatter understand Oracle-specific syntax?

Yes. The query is parsed against Oracle grammar rather than generic SQL, so Oracle-only constructs survive formatting: ROWNUM, NVL, || concatenation, TO_CHAR/TO_DATE.

What is the difference between formatting and beautifying Oracle SQL?

Nothing — they are two names for the same operation. "Format" usually describes tidying SQL you wrote yourself; "beautify" usually describes expanding a minified or ORM-generated one-liner into readable lines. This page does both, with a worked example of each above.

Is my SQL uploaded anywhere?

No. Formatting runs entirely in your browser — the query never leaves your machine and nothing is stored on a server.

Is the Oracle formatter free?

Yes: free, no account, no usage limit. Only the optional AI features — explain, optimize and dialect conversion — require signing in.

All SQL formatters & beautifiers

Format PostgreSQLFormat MySQLFormat T-SQLFormat SQLiteFormat BigQueryFormat OracleFormat SnowflakeFormat Redshift