Turn a web table into Markdown or JSON (for ChatGPT, GitHub and notes)
Published by Quillfold, which makes TablePick.
When you paste a table copied from a web page into a field that only takes text (many forms, code editors, chat inputs), the column boundaries can be lost: the values run together, or every cell ends up on its own line. Or you need the table as JSON for code.
Markdown and JSON are both plain text, so they survive any text box. This guide covers why pasting can break, what each format can and can’t hold, and the ways to convert.
Why a pasted table falls apart
When you copy part of a web page, the browser puts more than one version on the clipboard. The W3C Clipboard API draft says browsers “should create alternate text/html and text/plain clipboard formats when content in a web page is selected.”
The place you paste into decides which version it uses:
- Spreadsheets and rich-text editors can use the HTML version, which still has the table’s rows and cells.
- A plain text box (many chat inputs, code editors, issue forms) gets the plain-text version. It has no table structure, only text, and how the cell boundaries come through depends on the browser and the page. Merged cells, links and footnotes make it worse.
So the fix is to turn the table into a text format that carries its own structure before you paste.
Markdown tables: what they can hold
A Markdown table, as defined in the GitHub Flavored Markdown (GFM) spec, is “a single header row, a delimiter row separating the header from the data, and zero or more data rows”:
| Country | Population (2023) |
| --- | --- |
| India | 1,438,069,596 |
| China | 1,422,584,933 |
Figures from Wikipedia, List of countries and dependencies by population (United Nations) (checked 16 October 2026).
GitHub renders this as a table in issues, pull requests, comments and README files. GitHub Docs say there must be at least three hyphens in each column of the header row and a blank line before the table.
The limits matter for web tables:
- One header row. A two-row header (“2024” over “Q1, Q2”) has to be flattened into one row first.
- No merged cells. The syntax has no way to span rows or columns. A value that spans three rows must be repeated or left in the first row only.
- Pipes must be escaped. A
|inside a cell ends the cell unless written as\|. GitHub Docs: “To include a pipe | as content within your cell, use a \ before the pipe.” - No line breaks inside a cell. Each row is one line, and “Block-level elements cannot be inserted in a table” (GFM spec). GitHub allows the HTML tag
<br>inside a cell: we rendered| Line<br>break | a\|b |through GitHub’s Markdown API on 16 October 2026 and got a line break in the first cell anda|bin the second. - Row length. GFM fills short rows with empty cells and drops extra cells. A row that lost a cell because of a merged cell silently shifts left.
JSON: decisions to make
For code, the usual shape is an array of objects, one per row, keyed by the column header:
[
{ "Country": "India", "Population (2023)": "1,438,069,596" },
{ "Country": "China", "Population (2023)": "1,422,584,933" }
]
Things a converter has to decide, and that you should check in its output:
- Duplicate headers. Two columns called “Population” can’t both be keys in one object; one gets dropped unless the keys are made unique.
- Empty headers. A column with no header needs some key.
- Numbers.
1,438,069,596,−0.18%and$12.50are text on the page. Converters differ in whether they keep these as strings, so check the output; turning them into numbers is a separate step, and the right rule depends on the locale (in many European tables,1.234,5means 1234.5). - Merged cells and two-row headers, as for Markdown.
Ways to convert
Paste into a GitHub text box
GitHub’s changelog of 19 May 2022 says that in pull requests, issue comments and wikis, “Spreadsheet cells and HTML tables will render as Markdown tables” when pasted, and that Ctrl+Shift+V (Cmd+Shift+V on Mac) pastes without this. Paste into a comment, then click Preview to check. GitHub also publishes an open-source library for this, paste-markdown; what follows is from this library’s source (read on 16 October 2026), not a test of github.com itself. It takes the first row as the header and, from the second row on, picks up only <td> cells, so any <th> cell in those rows is dropped wherever it sits, and a row made only of <th> cells (such as a second header row) comes out empty. It reads cells with textContent, so hidden text such as Wikipedia’s sort keys is included; it also escapes |, turns line breaks into spaces, and doesn’t expand rowspan or colspan. For a simple table it is the quickest route.
Online converters
Sites such as tableconvert.com have an “HTML Table to Markdown” page: you paste the table’s HTML (right-click the table, Inspect, then copy the <table> element) and copy the result. On its “Convert HTML Table to Markdown Table Online” page, the site says the conversion runs in your browser and the data doesn’t leave your device (checked 16 October 2026). For data that must not leave your organisation, check that statement and whether the page makes network requests before using it.
Browser extensions
Several Chrome extensions copy a table as Markdown, and some are aimed at pasting into AI tools. One, Copy as Markdown for AI, says in its store listing (read 16 October 2026) that it “Automatically expands merged cells (rowspan/colspan) into clean GFM tables” and that “No data leaves your browser”. Not every extension describes how it treats merged cells. Before relying on one, check on a table with merged cells and a two-row header: whether values land in the right columns, and whether | inside a cell is escaped.
Code
If you write Python, pandas.read_html reads every table on a page into DataFrames and “attempts to properly handle colspan and rowspan attributes” (pandas 3.0 documentation). DataFrame.to_json(orient="records") then gives the array-of-objects shape above (pandas documentation for to_json).
Pasting a table into an AI tool
A table from an internal system pasted into an external service leaves your computer. Check your organisation’s rules first.
What TablePick does
TablePick is our extension. It reads the tab you have open and exports the table you choose as Markdown or JSON (or XLSX, CSV, TSV). This is what the export code and its tests do today:
- Markdown is a GFM table: one header row, a
| --- |delimiter row, then the data.|in a cell becomes\|and\becomes\\. Line breaks inside cells become spaces by default; with Keep line breaks inside cells on, they are written as<br>. - JSON is an array of objects keyed by the column headers, indented with two spaces. A duplicate header gets a suffix (
Name,Name_2), and an empty header becomescolumn_1,column_2and so on, by position. All values are strings, exactly as shown on the page. - Optional report. With Include report on, the JSON becomes
{ "report": …, "rows": [ … ] }, where the report records the source address, time, pages, row count check and stop reason. This applies only when you save a file; Copy never adds the report, and Markdown never includes it. - Before the conversion, merged cells are expanded into every row they cover (switchable), multi-row headers are joined into one row (
2024 / Q1), hidden rows are left out by default, and footnote marks like[1]can be removed. You can rename, reorder and hide columns in the panel. - Copy puts the Markdown or JSON text on the clipboard when that format is selected, so you can paste straight into a chat box or editor.
- Local processing. The table is read and converted inside your browser; table data is not sent anywhere.
All of this is on the free plan. Tables spread over several pages can be collected into one export: up to 3 pages per capture on the free plan, more with Pro. Pro also adds Clean numbers (1,234.5 becomes 1234.5), but in JSON the result is still a string.
When you don’t need any of this
- A small table with one header row and no merged cells, going into GitHub: paste it into the comment box and check the preview.
- A table already in Excel or Google Sheets: copy the cells from there instead. GitHub converts pasted spreadsheet cells into a Markdown table too.
- Data that the site offers as a CSV or JSON download or through an API: use that. It is the most complete source.
For merged cells and two-row headers in more detail, see Merged cells and “Column 1” headers. For Wikipedia tables in particular, see Get a Wikipedia table into Excel or CSV. For spreadsheets, see Getting a web table into Excel.
Sources
Read on 16 October 2026.
- Wikipedia, “List of countries and dependencies by population (United Nations)” (example figures): https://en.wikipedia.org/wiki/List_of_countries_by_population_(United_Nations)
- W3C, “Clipboard API and events” (Working Draft, 24 June 2026), §8.1 “The copy action”: https://www.w3.org/TR/clipboard-apis/
- GitHub Flavored Markdown Spec, “Tables (extension)”: https://github.github.com/gfm/#tables-extension-
- GitHub Docs, “Organizing information with tables”: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables
- GitHub Docs, REST API “Render a Markdown document” (used to check
<br>and\|rendering): https://docs.github.com/en/rest/markdown/markdown - GitHub Changelog, “Updates to Markdown pasting on GitHub” (19 May 2022): https://github.blog/changelog/2022-05-19-updates-to-markdown-pasting-on-github/
- github/paste-markdown, README and
src/paste-markdown-table.ts: https://github.com/github/paste-markdown - Chrome Web Store, “Copy as Markdown for AI” (updated 12 May 2026): https://chromewebstore.google.com/detail/hlokilfnpkffapncbfieeenebggdenfj
- tableconvert.com, “Convert HTML Table to Markdown Table Online”: https://tableconvert.com/html-to-markdown
- pandas documentation,
pandas.read_htmlandDataFrame.to_json(version 3.0): https://pandas.pydata.org/docs/reference/api/pandas.read_html.html, https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_json.html