SQL to Markdown Table Converter
Convert terminal output from MySQL, PostgreSQL, SQLite, or database CLI tools into clean Markdown tables. Strip borders (+---+), parse column names, and paste formatted query results directly into GitHub issues, Pull Requests, or architecture documentation.
How to Use This Tool
Copy SQL CLI Output
Copy the ASCII table result printed in your terminal or database GUI query console.
Paste into Tool
Paste the output containing +---+ borders or pipe columns into the tool below.
Copy Markdown Table
The SQL borders are automatically stripped and converted into a standard GitHub Markdown table.
Worked Example
+----+------------------+---------+ | id | database_name | status | +----+------------------+---------+ | 1 | production_db | online | | 2 | analytics_store | synced | | 3 | redis_cache | active | +----+------------------+---------+
| id | database_name | status | | :- | :-------------- | :----- | | 1 | production_db | online | | 2 | analytics_store | synced | | 3 | redis_cache | active |
SQL CLI Result Parsing & Fixed-Width ASCII Border Stripping
Command-line SQL tools (MySQL, PostgreSQL psql, SQLite, SQL Server sqlcmd) format query outputs using fixed-width ASCII border art (+---+---+ and | column |). Our specialized parser strips bounding box lines, extracts column names from the header row, discards terminal status messages ("2 rows in set"), and outputs clean GitHub Flavored Markdown.
Markdown Table Pro Tips & Best Practices
Document Database Queries
DevOpsCopy query output straight from your terminal into this tool to document schema changes and migrations in GitHub PRs.
Right-Align Numeric Counts & IDs
DatabasesNumeric database metrics (counts, timestamps, foreign keys) should be right-aligned (---:) for cleaner documentation.
Strip Terminal Prompts
Clean DataOmit the mysql> or postgres=# prompt lines when copying to ensure pure tabular parsing.
Highlight Primary Keys with Code
ReadabilityWrap ID column names in backticks (`user_id`) in your final Markdown output for clear technical contrast.
Common Pitfalls & How to Fix Them
Terminal summary lines appear as extra rows
Cause: Lines like "(3 rows)" or "Query OK" were copied along with query results.
Columns merged together
Cause: Query output was copied from a terminal that uses spaces instead of vertical pipes.
Platform & Markdown Flavor Compatibility
| Platform / Specification | Support Status | Compatibility Notes |
|---|---|---|
| MySQL & MariaDB CLI | Supported | Detects standard ASCII tabular outputs. |
| PostgreSQL psql | Supported | Supports both border=1 and border=2 psql formats. |
| SQLite3 CLI | Supported | Parses .mode column and .mode box query results. |
| SQL Server sqlcmd | Supported | Parses dashed separator lines from MS SQL. |
Frequently Asked Questions
Can I convert full SQL schema dumps or database manuals to Markdown?▼
This converter specifically parses ASCII tabular outputs from SQL query results into clean Markdown tables. If you need complete document conversions (such as turning technical specifications into PDF, Word DOCX, or HTML), visit our sister platform MDConverter (https://mdconverter.net).
Does this handle PostgreSQL table outputs without + borders?▼
Yes. Both MySQL-style bordered tables (+---+---+) and PostgreSQL-style column separator tables (----+----) are parsed accurately.
Can I paste comma-separated SQL dump rows?▼
Yes. If your query outputs CSV-formatted rows, our engine detects the commas and formats them into a table.
Does this execute SQL queries on my database?▼
No. This tool only formats text. You paste the terminal text output of a query you ran locally, and it converts it into a Markdown table.
Can I convert psql expanded display (\x) outputs?▼
Standard columnar tables are supported. For key-value vertical records, use our Markdown Table Transpose tool after converting.
How are SQL NULL values handled?▼
By default, SQL NULL tokens are cleaned to empty cells, or you can retain them as italicized *NULL* text.
Need Whole Document Conversion?
MarkdownTables.com is built exclusively for Markdown tables and tabular data. If you need to convert entire Markdown documents, essays, or notes (with headings, paragraphs, lists, and images) to PDF, Word (DOCX), or PowerPoint, visit our sister platform.