Kharabeesh
On-device ع

SQL Formatter & Minifier

Format SQL queries for MySQL, PostgreSQL, SQL Server, SQLite and more, with keyword case and indentation options, or minify them to one line without comments.

Free, no sign-up Saved on your device only Works offline after first open

The tool

Loading the tool…

How to use

  1. Paste a query or open a .sql file.
  2. Choose the dialect and keyword case.
  3. Choose Format to tidy it or Minify for one line, then copy the result.

Privacy & how it works

Saves your data in this browser only (back it up or delete it from “My data”).

  • Engine: sqlFormatter (open-source libraries bundled with the site).
  • Works offline after you open it once.

Frequently asked questions

Why do some queries show an error?

The formatter reads the query using the selected dialect. If it uses syntax from another database (such as SQL Server [brackets] or PostgreSQL $$), pick the right dialect.

Does minifying remove important comments?

It removes ordinary -- and /* */ comments but keeps /*! (MySQL directives) and /*+ (Oracle hints). # counts as a comment only for MySQL and MariaDB.

Does it run the query?

No. It only rearranges the text and never connects to a database.

Related tools