KOENJP

SQL Formatter & Minifier

SQL · FORMAT · MINIFY

Beautify long one-line SQL queries with clean line breaks and indentation, or minify them to a single line. Choose from many database dialects, keyword case and 2-space, 4-space or tab indent, then copy or save as .sql.

SQL

Result


      

Formatted in your browser only. Your queries are never uploaded. Formatting uses the open-source sql-formatter library (MIT).

Good to know. This only tidies the layout. It doesn't run or validate your query. Syntax the chosen dialect doesn't know may fail to format, so try another dialect. Minifying removes comments (-- and /* */).

HOW TO

How to use

  1. Paste your SQL. Separate multiple statements with semicolons.
  2. Pick the dialect for your database, or leave it on Standard SQL.
  3. Choose keyword case and indent (2 spaces, 4 spaces or tab) and the result updates instantly. Switch to Minify for a single line.
  4. Copy the result or save it as a .sql file.
PAIRS WELL WITH

Pairs well with

FAQ

FAQ

Is my query uploaded anywhere?

No. Formatting and minifying both run in this browser, so table names and conditions never leave your device.

It says it couldn't format my SQL.

This usually means the query uses syntax the selected dialect doesn't know, such as a database-specific function or quoting style. Switch to the dialect your database actually uses.

Does it find errors in my query?

No. It only tidies the layout. It doesn't run the query or check that tables and columns exist.

What does minify change?

It removes comments (-- and /* */) and collapses whitespace and line breaks. Text inside quotes is left untouched.