How to paste an Excel or Numbers table into Markdown

Checked November 2026 against the official pages linked below. Coffee isn't affiliated with iA Writer or Obsidian.

When you copy cells from Excel, Numbers or Google Sheets, you get text with tabs between the columns. A Markdown table wants pipes between the columns and a separator row under the first line. So you need something to convert one to the other: a Terminal command, a converter, or an editor that does it when you paste.

What the result should look like

Three copied rows should end up like this:

| Plan | Price |
| --- | --- |
| Monthly | €3 |
| Yearly | €29 |

The first row is the header, and the second row of dashes is what makes it a table. It doesn't need to line up neatly in the source. Add colons to align a column: :--- for left, ---: for right, :---: for centre.

With one line in Terminal

Copy your cells, run this, and the clipboard then holds a Markdown table ready to paste anywhere. It uses tools your Mac already has.

pbpaste | tr '\r' '\n' | sed '/^$/d' | awk -F'\t' 'NR==1{h="|";for(i=1;i<=NF;i++)h=h" --- |"} {gsub(/\|/,"\\|");s="|";for(i=1;i<=NF;i++)s=s" "$i" |";print s} NR==1{print h}' | pbcopy

It treats the first row as the header, and escapes any | in a cell so it doesn't break the table. Save it as a shell alias if you do this often.

With an online converter

Plenty of sites will convert a table for you, and they work fine. Before you paste a budget or a client list into one, check whether it does the work in your browser or sends your data to a server. If you can't tell, assume it sends it.

What Markdown tables can't hold

This is what catches people out, whichever method you use. A Markdown table is much simpler than a spreadsheet:

  • No merged cells. Every row has the same number of columns.
  • No formulas. You get the values as they appeared when copied, so a rounded figure stays rounded.
  • No line breaks inside a cell in standard Markdown. Some renderers accept <br>.
  • No colours, or column widths. The app showing the table decides those.

If your table depends on any of these, Markdown is the wrong place for it. Export an image or keep a link to the spreadsheet. Also think about whether the table needs to stay as data. On the Mac, iA Writer can embed a CSV file as a content block, so the data stays in its own file and is drawn as a table in Preview. Obsidian's Importer plugin takes a different approach, with one note per row.

In Coffee

In Coffee you copy the cells and press ⌘V. There's no special paste command to remember.

Plan	Price
Monthly	€3
Yearly	€29
The copied cells, then the table Coffee makes from them.

From there it's an ordinary Markdown table in an ordinary .md file. In the note, Tab moves to the next cell, and pressing Tab past the end adds a row. Any | in a cell is escaped for you.

It does this when the clipboard holds at least two rows and two columns, with the same number of columns in every row. Anything else stays as it is, so one row, one column, or a block of tab-indented code pastes as plain text. Pasted text has to be under about a megabyte.

When a cell has a line break in it, the rows no longer match. If you're in the page view, Coffee then tries the formatted copy that spreadsheets also put on the clipboard. Check the result for tables like that, because it's the part most likely to need fixing by hand. It can't do anything about the limits listed above, either: a merged cell still has to become ordinary cells.

Coffee's calculations skip table rows on purpose, so a pasted table won't get answers beside it, or totals.

Tips for a table people can read

  • Keep it narrow. Four or five short columns read well on a page. A twelve-column export doesn't, in any app.
  • Format the numbers before you copy. What you see in the spreadsheet is what you get.
  • Put the unit in the header. "Price (€)" repeats less than €12, €14, €9 down the column.
  • Check how it exports. Wide tables are where a PDF usually goes wrong, so try that before you send it.