SQL to Markdown Table Generator — Free, No Upload
Turn a CREATE TABLE schema or a pasted query result into a clean Markdown table for READMEs and docs. Supports psql/mysql CLI output, CSV/TSV, and INSERT statements, plus batch multi-table schema docs.
What it does
Paste a CREATE TABLE statement to get a documentation-ready Markdown table of its columns, types, nullability, defaults, and keys — perfect for a README or a data-dictionary doc. Or switch to Query Result mode and paste an actual result set — from a psql/mysql CLI session, a CSV/TSV export, or a batch of INSERT INTO statements — and get a clean, properly aligned Markdown table back. Paste a full multi-table schema dump in Schema mode and it generates one heading and table per CREATE TABLE, concatenated into a single ready-to-paste document.
How it works
Schema mode uses the same tolerant CREATE TABLE parser as this site’s other SQL tools, extracting each column’s name, type, nullability, default value, and whether it’s a primary key, foreign key, or unique column. Query Result mode auto-detects the shape of whatever you paste: a bordered or unbordered CLI table (the kind psql or the mysql command-line client prints), delimited text (CSV or TSV, with full support for quoted fields), or one or more INSERT INTO table (cols) VALUES (...), (...); statements — including correctly handling NULL, escaped quotes, and commas embedded inside string values.
Numeric columns are automatically right-aligned in the generated table (GFM markdown supports per-column alignment via the header separator row), while everything else stays left-aligned. You can choose between visually padded output, where every column is space-aligned for a clean look in a plain-text editor, or compact output, which renders identically once processed by a Markdown engine but produces a smaller file.
How to use it
- Choose Schema mode (documentation from a table definition) or Query Result mode (a table from actual data).
- Paste your SQL or drop a file — for Schema mode, paste one or more
CREATE TABLEstatements; for Query Result mode, paste CLI output, CSV/TSV, orINSERTstatements. - In Schema mode, optionally turn on “Add a Description column” to annotate each field by hand before exporting — useful for a proper data dictionary.
- Copy the Markdown or download it as a
.mdfile. A live preview shows exactly how it will render.
Supported query-result formats
- CLI ASCII tables — both the bordered
mysqlclient style (+----+----+) and the unborderedpsqlstyle (a plain---+---separator line), including a trailing(N rows)footer. - CSV / TSV paste — auto-detected delimiter, with quoted-field support.
- INSERT statements — one or more
INSERT INTO table (cols) VALUES (...), (...);statements against the same table, including multi-rowVALUESlists.
FAQ
Does this run a query against my database? No — it only reformats SQL or data you’ve already pasted or exported yourself. Nothing is sent anywhere.
Can I document a whole schema at once, not just one table? Yes — paste a dump with multiple CREATE TABLE statements in Schema mode and it generates one table (with its own heading) per table, ready to paste into a single README section.
What’s the Description column for? It adds an extra editable column so you can annotate what each field actually means before generating the final Markdown — handy for turning a raw schema into a proper data dictionary. Type your notes in the panel that appears once the toggle is on; the generated table updates as you type.
Why is my query result table not detected correctly? Format detection looks for the structural markers of each format (borders and dashes for CLI tables, INSERT INTO for statements, otherwise falls back to delimited text). If a paste has extra text mixed in — like a full psql session with prompts — trim it down to just the table output for the cleanest result.
Does it support column alignment other than the auto left/right numeric detection? The generator auto-aligns based on content (numeric columns right-align, everything else left-aligns) to match common Markdown table conventions. For manual control over a specific layout, edit the generated Markdown’s separator row directly — :--- left, ---: right, :---: center.
Can I turn off the visual padding? Yes — “Pad/align columns visually” controls whether the raw Markdown source has space-aligned columns. Either way, the table renders identically once processed by GitHub, GitLab, or any GFM-compatible Markdown viewer.
If your data started life as a spreadsheet, the spreadsheet viewer can open it and export CSV to paste into Query Result mode. For turning the same schema into a visual diagram rather than a doc table, try the SQL → ER diagram tool, and to track how a schema changed over time, the SQL schema diff checker compares two versions and can generate migration SQL.