SQL Formatter / Prettifier - MacigHub

Pretty print SQL queries (SELECT, INSERT, CREATE, ALTER). Multi-dialect: MySQL, PostgreSQL, SQLite, MSSQL.

Popular tools: Base64 · JSON Diff · UUID · QR Code · Regex · Password

About this tool

What does it do?

It reformats SQL with consistent capitalization, indentation and line breaks per clause — turning generated or minified queries into reviewable code, and can minify back for embedding.

How to use it

  • Paste SQL to format instantly.
  • Pick keyword case to match house style.
  • Copy back into migrations, editors or tickets.

Examples

  • Reviewing a 60-line ORM-generated SELECT.
  • Standardizing keyword case across a migration repo.
  • Minifying a query for a dashboard JSON blob.

Important limitations

  • Formatting never fixes logic — wrong joins stay wrong, prettier.
  • Dialect quirks (T-SQL brackets, backticks) need the right mode.
  • Always EXPLAIN after reformatting performance-sensitive queries.

Privacy

Local formatting. Queries often embed schema and business logic — they stay on your device.

Frequently asked questions

Uppercase keywords?

Convention, not requirement — pick one and lint it.

Will it validate?

Syntax highlighting catches gross errors; run against the real engine to be sure.

Minified SQL readable?

No — minify only for embedding, never for review.

Related tools

JSON to CSV · Text diff · Regex tester