DevDock
All toolsDeveloper

MySQL Formatter

Paste a messy MySQL query — pretty-print or minify with MySQL dialect selected.

Pretty-print or minify SQL in your browser — CTEs, windows, and joins. Nothing is uploaded.

UPPER / lower rewrite keywords. Preserve keeps whatever case you typed — if the input is already lowercase, lower and Preserve look the same.

Sponsored

Ad space

How to use this tool

  1. Paste MySQL from a log, console, or editor (dialect is already MySQL).
  2. Choose Format or Minify, keyword case, and indent.
  3. Copy the result — or Copy as string for a JS/TS literal.

Readable MySQL without uploading schemas

One-line queries from APM, ORM logs, or phpMyAdmin are hard to review. This page opens with the MySQL dialect so quoting and keywords match the engine you actually run — still fully client-side.

Prefer Postgres? Try the PostgreSQL Formatter. Need every dialect in one place? Use the SQL Formatter.

FAQ

Is this MySQL-specific formatting?

Yes. The dialect starts on MySQL so backticks, keywords, and quirks match what you’d run in MySQL Workbench, mysql CLI, or a MySQL-flavored ORM.

Does it execute my query?

No. It only reformats whitespace and keyword case (or minifies). It never connects to a database.

Is my SQL uploaded?

No. Formatting stays in your browser. Table and column names never leave your device.

What about MariaDB?

MariaDB is close to MySQL. You can switch the dialect dropdown to MariaDB on this same workspace, or use the general SQL Formatter hub.

What does Copy as string do?

It wraps the formatted SQL as a JavaScript/TypeScript string literal with escapes, so you can paste into app code without hand-escaping quotes and newlines.