Google Spreadsheet to Markdown Table Converter
Convert Google Sheets to Markdown tables instantly. Paste a published spreadsheet URL or CSV data and get a formatted Markdown table.
Sheet must be published via File → Publish to Web
About
Markdown tables are notoriously tedious to write by hand. A misaligned pipe character or a missing separator row breaks the entire render. This tool converts published Google Spreadsheets or raw CSV/TSV data into properly formatted Markdown tables with correct column alignment. It fetches data directly from Google's public CSV export endpoint, parses it with full RFC 4180 compliance (handling quoted fields, escaped double-quotes, and embedded newlines), then generates a pretty-printed table with padded columns. It also auto-detects numeric columns and applies right-alignment via the : separator syntax. Note: the source spreadsheet must be published to the web via File → Publish to Web. Private or restricted sheets cannot be accessed from a browser without OAuth.
Formulas
The converter constructs a GFM-compliant Markdown table following this structure pattern:
| sep1 | sep2 | … | sepn |
| C1,1 | C1,2 | … | C1,n |
Where Hi is the header cell for column i, sepi is the separator which controls alignment: :--- for left, ---: for right, :---: for center. Cr,i is the cell content at row r, column i. Column width Wi is calculated as:
The minimum width of 3 ensures valid separator syntax. Pipe characters (|) within cell content are escaped to \| before width calculation. Numeric detection uses the pattern: a column is right-aligned if ≥ 60% of its non-empty body cells match /^[\-+]?[\d,._]+[%]?$/.
Reference Data
| Feature | Details |
|---|---|
| Google Sheets URL | Extracts sheet ID via regex, fetches CSV from docs.google.com/spreadsheets/d/{id}/export?format=csv |
| Multi-sheet support | Append &gid= parameter to select specific sheet tab |
| CSV Parsing | RFC 4180 compliant: quoted fields, escaped quotes (""), embedded newlines |
| TSV Support | Auto-detects tab-delimited data when no commas found |
| Column Alignment | Auto-detects numeric columns → right-align (---:), text → left-align (:---) |
| Pretty Print | Pads cells to uniform column width for source readability |
| Compact Mode | Outputs minimal Markdown without padding for smaller file size |
| Header Row | First row always treated as <thead> |
| Empty Cell Handling | Preserves empty cells as whitespace between pipes |
| Pipe Escaping | Literal | in cell content escaped as \| |
| Newline Handling | Embedded newlines in cells replaced with <br> tags |
| Max Columns | No limit. Horizontal scroll on preview for wide tables |
| Max Rows | Tested up to 10,000 rows without performance issues |
| Output Formats | Copy to clipboard or download as .md file |
| Persistence | Last input URL and settings saved to localStorage |
| Markdown Spec | GitHub Flavored Markdown (GFM) table syntax |
| Error Recovery | Graceful fallback for CORS errors, invalid URLs, empty sheets |
Frequently Asked Questions
HTML tags, which most Markdown renderers (including GitHub) support inside table cells.