Oracle PL/SQL Formatter

Paste a Oracle PL/SQL query and get it laid out clause by clause — with Oracle Database syntax handled correctly.

Input · drop a file

Output

Oracle PL/SQL-specific syntax this formatter understands

  • Oracle outer-join syntax (+), ROWNUM and SYSDATE are preserved
  • BEGIN … END; blocks, DECLARE sections and EXCEPTION handlers are indented
  • :bind variables are kept as single tokens
  • FETCH FIRST n ROWS ONLY and CONNECT BY format as clauses

Formatting changes only whitespace and keyword case. What the query does is unchanged. Need another database? The main SQL formatter has 11 dialects, and the SQL minifier squeezes a query onto one line.

Questions

Is this Oracle PL/SQL formatter free and private?

Yes. It runs in your browser using the open-source sql-formatter library; your query is never uploaded.

Can it format stored procedures and packages?

Yes for common PL/SQL blocks. Very large packages are easiest to read if you format one procedure at a time.

Does it check my query against my schema?

No — it understands the syntax, not your tables. A nicely formatted query can still reference a column that doesn’t exist.

Related tools