SQL Formatter Online — Free SQL Query Beautifier & Minifier

Format complex and messy SQL code into clean, readable, properly indented queries in your browser.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Choose your settings

    Fill in the details or pick the options you need.

  2. 2
    See the result

    The preview updates right away as you change things.

  3. 3
    Download or save it

    Save the result to your device. Nothing is sent to or stored on a server.

About this tool

Format SQL statements with customizable indentation (2 spaces, 4 spaces, or Tabs), keyword capitalization (UPPERCASE or lowercase), and clause line breaks. Also includes one-click SQL minification.

Tips for best results

Take a moment to read the options before you start, and try the tool with a small sample first. Everything runs in your browser on your own device, so nothing you type or add is uploaded, and closing the tab clears it. If something does not look right, reload the page and try again, or use the report link on this page to tell us what went wrong so we can fix it. If a result still looks wrong, change one value at a time to see which box matters most. Bookmark this page if you will need the tool again.

Quick facts

Frequently asked questions

Which SQL dialects are supported?

It supports Standard ANSI SQL, PostgreSQL, MySQL, MariaDB, SQLite, Oracle, and MS SQL Server queries.

Can I minify SQL queries for production?

Yes, click the Minify button to strip comments and redundant whitespace, compressing your query into a single line.

Can I change keyword casing?

Yes, choose between UPPERCASE, lowercase, or Preserve casing for all major SQL keywords.

Is my database query kept private?

Yes. Formatting is calculated directly in your browser. Your database schema and query logic never leave your browser.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages