SQL Minifier

Paste a SQL query to instantly strip comments and excess whitespace, producing a compact single-line output.

Original SQL

0 chars

Options

Minified SQL

0 chars
Copied!

Summary

Paste a SQL query to instantly strip comments and excess whitespace, producing a compact single-line output.

How it works

  1. Paste your SQL query into the input box.
  2. The minifier removes /* block comments */ and -- single-line comments.
  3. All newlines, tabs, and consecutive spaces are collapsed into one space.
  4. The result is trimmed and displayed in the output box.
  5. Click "Copy Minified SQL" to copy it to your clipboard.

Use cases

  • Embed compact SQL in application config files or environment variables.
  • Reduce query string length when logging or tracing SQL statements.
  • Quickly strip development comments before pasting into production scripts.
  • Compare minified length vs. original to see how much whitespace was added.
  • Prepare SQL strings for inclusion in source code string literals.
  • Clean up auto-generated SQL before sharing with teammates.

Frequently Asked Questions

Last updated: 2026-07-01 · Reviewed by Nham Vu