Oracle SQL Formatter

Beautify Oracle SQL and PL/SQL, including hierarchical queries, bind variables and Oracle string quoting.

Runs in your browser

SQL

Formatted SQL

Your SQL is processed in this browser tab and never uploaded.

How to use the Oracle SQL Formatter

  1. Paste your Oracle query into the editor, or press Sample to load an example.
  2. The Oracle dialect is already selected, so dialect-specific syntax is parsed correctly.
  3. Press Format (Ctrl + Enter). Pick indentation and keyword case in the options.
  4. Copy the result or download it as a .sql file.

Example

A Oracle query before formatting
Input
select employee_id, last_name, manager_id, level from employees start with manager_id is null connect by prior employee_id = manager_id order siblings by last_name;

Oracle syntax this formatter understands

  • Hierarchical queries using START WITH and CONNECT BY are laid out clearly.
  • Bind variables such as :customer_id and substitution variables are recognised.
  • Oracle q-quoted strings like q'[it's here]' are treated as literals.
  • Formatting PL/SQL blocks (BEGIN ... END) is supported for common statements; very complex packages may need manual touch-ups.

What it does

Oracle-aware parsing
Uses the Oracle grammar from the open-source sql-formatter library, so syntax that is specific to Oracle is handled correctly.
Keyword case control
Keep the original case, or convert all keywords to UPPERCASE or lowercase as you format.
Private by design
Formatting happens on your device. Nothing you paste leaves the browser.

Frequently asked questions

Is my Oracle query sent to a server?

No. The formatter runs entirely in your browser. Your query is never uploaded, logged or stored, so it is safe to paste production SQL.

Will formatting change what my query does?

No. Only whitespace, line breaks and (if you choose) keyword case change. String literals, quoted identifiers and comments are kept exactly as written.

Does it validate my query?

The formatter has to parse your query, so badly broken SQL produces an error with its location. It does not check that tables or columns exist, and some invalid queries still format.