Data and JSON tools Free · No sign-up · No upload

SQL Formatter

Turn a tangled one-line query into readable, indented SQL. Choose your dialect, keyword case and indent. Your queries, and the table names in them, stay in your browser.

  • No registration
  • No server involved
  • 16 SQL dialects
  • Keyword case control
SQL
  • Runs on your device. Files are never uploaded.
  • Free and unlimited. No sign-up, no watermark.
Private: processed in your browserNo upload waitIN: SQL → OUT: SQL
How was SQL formatter?
How it works

SQL formatter in three steps

No account, no email, no waiting for an upload.

  1. STEP 01

    Paste or open your SQL

    One query or a whole script. Open a .sql or .txt file if you prefer.

  2. STEP 02

    Pick dialect and style

    Choose the SQL flavor, uppercase, lowercase or as-written keywords, the indent, and blank lines between statements.

  3. STEP 03

    Copy or download

    The formatted SQL is ready to paste into your editor or review.

What you get

What SQL formatter does, and what it doesn't

We'd rather tell you up front than surprise you after the download.

What you get

  • Sixteen dialectsStandard SQL, PostgreSQL, MySQL, MariaDB, SQLite, SQL Server (T-SQL), Oracle PL/SQL, BigQuery, Snowflake, Redshift, Spark, Trino/Presto, DuckDB, ClickHouse, IBM Db2 and Hive.
  • Keyword caseUPPERCASE, lowercase, or keep as written.
  • Indent options2 spaces, 4 spaces or tabs.
  • Multi-statement scriptsChoose 0 to 5 blank lines between statements.
  • Comments keptComments stay in the output, so your notes are not lost.

Good to know

  • Formatting, not validatingIt rearranges whitespace and keyword case. It does not run the query or check that tables and columns exist.
  • Dialect must fitSyntax from another database may fail to parse. If you see an error, try a different dialect.
  • Stylistic choicesThe layout is one consistent style, not configurable line by line.
Private by design

Your data never leave your device

The tool runs inside your browser instead of on our servers, so there is nothing to upload, store or delete afterwards.

Typical online tool upload

Your device→Their server→Your device

Your file travels over the internet, sits on someone else's computer for a while, and you wait for the upload and the download.

Mediaextractr no upload

Your device does all the work

The tool loads into your browser once, then works on your file locally. Nothing is sent, so nothing can leak.

Made for real work

When people use SQL formatter

Review a pasted query

Make a query from a log or ORM readable.

Standardize team SQL

Keep scripts consistent in a repo.

Understand a long query

Break it into clauses and joins.

Share clean SQL

Post readable code in a ticket or chat.

Compare

Mediaextractr vs typical upload tools

MediaextractrPrivateTypical upload tools
Your file is uploadedNeverYes
Sign-up neededNoOften, after a few files
Daily file limitNoneOften 1–2 free files
WatermarkNeverSometimes
Wait for upload & downloadNoYes
Speed on very large filesDepends on your deviceDepends on their servers

What the formatter changes

Each major clause (SELECT, FROM, WHERE, GROUP BY and so on) starts on its own line. Selected columns, joins and conditions are indented. Parentheses and subqueries get their own indented blocks.

Only layout and keyword case change. Your identifiers, values, strings and comments stay as you wrote them.

Picking a dialect

Dialects differ in quoting, functions and operators. A few examples: PostgreSQL uses double quotes for identifiers and :: for casts, MySQL uses backticks, SQL Server uses square brackets and TOP, and BigQuery has its own struct and array syntax. Choosing the right one avoids parse errors.

Formatting for review

Format a query before reading or reviewing it, and again before pasting it into documentation. Keywords in uppercase help the eye find clauses; lowercase suits teams that prefer it. Pick whichever your team uses and stay consistent, since the formatter applies the same style to every statement in a script.

FAQ

Questions, answered

How do I format SQL online?

Paste the query, choose your dialect and copy the formatted result.

Is my SQL sent anywhere when formatted?

No. The formatter library runs in your browser tab, so schema names and business logic in a query stay private.

Why do I get an error?

The text may not be valid for the selected dialect. Try another dialect or check for a typo.

Does it change my query's meaning?

No. It changes whitespace and keyword case only.

Can it format multiple statements?

Yes. Separate them with semicolons and choose the number of blank lines between them.

Does the formatter work on a phone?

Yes. Recent mobile browsers run it. Long queries scroll sideways in the result.