Skip to content
DataCraft

SQL formatter and query beautifier

Turn a one-line query into a readable statement: one clause per line, one column per line, keywords in the case you prefer and the dialect you actually run.

  • Four SQL dialects
  • One column per line
  • Meaning-preserving by design
  • Nothing is uploaded

Dialect-aware, meaning-preserving

Every dialect brings its own keyword table and identifier quote character, and the formatter only rewrites whitespace and keyword case — string literals, comments and quoted names pass through unchanged.

Paste a query

One statement or many — comments, strings and quoted identifiers are never touched.

Indentation
Keyword case
Tokens
66
Statements
1
Input chars
224
Output chars
230
Token stream preservedFormatting only changes whitespace and keyword case — no token was added, removed or reordered.

Formatted query

PostgreSQL · 1 statement(s)

  • Strings, backticked or bracketed identifiers and both comment styles pass through byte for byte.
  • Identifiers are never re-quoted: PostgreSQL uses double quotes and the formatter respects that.

How it works

Data tools that run in your tab

No uploads, no sign-ups and nothing to wait for: parsing and formatting happen inside this page, so the result appears while you type.

  1. 1. Paste the data you already have

    A CSV export, a JSON payload, a one-line query. It stays in page state: the same textarea you typed into is what the parser reads.

  2. 2. Shape it with explicit options

    Delimiter, header row, column filter, indentation, dialect, keyword case. Nothing is guessed silently — every choice is a control you can see and change.

  3. 3. Watch the output update as you type

    Parsing is debounced so a large paste does not freeze the page, and the preview, the statistics and every export are produced from one parse.

  4. 4. Check it before you trust it

    Warning rows, token counts and byte savings are shown next to the result, so a broken quote or a lost token is visible instead of silent.

Privacy by architecture

Nothing is uploaded — and you can verify it

Privacy claims are cheap, so this one is falsifiable: the app has no upload code path at all.

  • No upload endpoint exists

    None of these tools has a POST route, a storage bucket or a proxy. Open DevTools → Network while you convert a file: the only requests are the page assets.

  • Your data stays in memory

    Files, queries and column choices live in React state inside the tab and are never persisted. Close the tab and they are gone — nothing survives, because nothing was stored.

  • Deterministic output, byte for byte

    The serialisers are hand-written and never consult the locale or the clock, so the same input produces exactly the same export every time you run it.

Free forever, no account required — the tools are static pages that run entirely on the client.

SQL formatter FAQ

Dialects, keyword casing, line-break rules and what happens to comments and scripts.

Which SQL dialects can I format for?

Standard SQL, MySQL, PostgreSQL and SQLite. The dialect selects the keyword set and the identifier quote character: backticks for MySQL and double quotes elsewhere, so the formatted statement stays valid for the engine you are targeting.

Does the formatter ever change my query's meaning?

No. It rewrites whitespace and keyword case only: string literals, comment text, quoted identifiers and every operator pass through unchanged. The token count of the output is shown next to the input's, and the page warns you if the two token streams ever differ.

Can I keep the keywords lowercase?

Yes. The keyword case control switches between UPPERCASE and lowercase, and the dialect keywords are the only tokens affected — a table or column named "select" in backticks is left exactly as you wrote it.

How does the formatter decide where to break lines?

A newline is inserted before each clause keyword (SELECT, FROM, WHERE, GROUP BY, JOIN, ORDER BY and so on), one nesting level is added for each open parenthesis, and commas inside a column list start a new line when "one column per line" is on. VALUES rows and CREATE TABLE definitions keep their commas inline so the data stays readable.

What happens to comments and multi-statement scripts?

Line comments (--), block comments (/* */) and semicolons are preserved, so a migration script with several statements formats statement by statement. Comments are never merged into the following clause line.

Is my query sent anywhere?

No. Tokenising and formatting happen in the tab with plain JavaScript, so schema names, credentials in literals and internal identifiers never leave your machine.

  • CSV & tables

    Parse comma, semicolon, tab or pipe separated files with quoted fields intact, then export JSON, a Markdown table, an HTML table or SQL INSERT statements — with a delimiter detector, duplicate removal and column filtering.

    Open tool
  • JSON formatter

    Validate JSON with an error position, format it with two spaces, four spaces or tabs, minify it, inspect the parse tree, and convert to YAML, XML or CSV with key count and depth statistics.

    Open tool
  • XML formatter

    Soon

    Pretty-print XML with configurable indentation, validate tag nesting and convert between XML and JSON. In development on the same client-side pipeline.

    In development