How to Convert an Excel Table to a Markdown Table
Learn how to turn an Excel range into a Markdown table by moving it through a Word table, with checks for headers, pipes and column counts.
If you keep data in Excel and need it in a README, a documentation site or a Markdown-based note, you will hit the same problem: Excel does not export Markdown. Copying cells straight into a text file gives you tabs or loose spaces, not a table that a Markdown renderer can read. This guide covers how to convert an Excel table to a Markdown table with a method that keeps the rows and columns intact.
The short answer is to move the range into a clean table structure first, then write it in Markdown pipe syntax. For a simple table, you can build the rows with an Excel formula and paste the result into a text file. For larger or messier tables, paste the range into a Word table, where each cell is clearly defined, and convert that table to Markdown from there.
How do you convert an Excel table to a Markdown table? The short answer
Use Excel for the data and a table structure you can check for the Markdown step. The right route depends on how complex the sheet is.
| Your situation | What to do | Why |
|---|---|---|
| Plain grid, under about 20 rows, no line breaks in cells | Build each row with a formula that adds pipes, then paste the rows into a text file | Fast, and nothing needs to be installed |
| Cells contain line breaks, merged cells or long text | Paste the range into a Word table, then convert that table to Markdown | Word keeps cell boundaries, so line breaks and merges are easier to see |
| You need the table inside a larger Word document | Build the table in Word and keep it as a .docx | The table stays editable and can be reused |
| You want to edit the Markdown in a browser-based editor | Open the .docx in the UniDoc web editor at app.unidoc.top and check the table there | The editor handles Word files and Markdown, so you can review the structure before you copy it out |
| The sheet has formulas that show results you need | Copy the displayed values, not the formulas | Markdown has no spreadsheet formulas, so only the results belong in the table |
Before you start
Check these points first, because they decide whether the Markdown table will render correctly.
- Confirm the header row. Markdown needs one header row and a separator row under it. If your Excel sheet has no header, add a short one, such as "Item" or "Column 1", so the table has a clear top row.
- Find pipe characters. A pipe (|) inside a cell ends the cell early in Markdown. Search the sheet for pipes and replace them with a slash or an HTML entity such as
|, depending on where the Markdown will be rendered. - Note merged cells. Markdown cannot span cells across columns or rows. Unmerge them and repeat the value in each cell, or accept a blank cell where a merge used to be.
- Decide how to handle line breaks. A line break inside a cell will break a Markdown row. Replace it with a space or a short phrase before you convert.
- Count the columns. Every row must have the same number of cells. Scroll to the far right of your range and make sure no stray values sit outside the table.
Converting an Excel range to Markdown, step by step
These steps use the Word-table route, which works for most spreadsheets. If your table is small and clean, you can skip to step 5 and use the formula method instead.
- Select the range in Excel. Include the header row and only the columns you want in the output. Copy it with your usual copy command.
- Paste it into a new Word document as a table. Paste the range into Word, then choose the option that keeps it as a table, not as an image or plain text. Each Excel cell should now sit in one Word cell.
- Clean up the table. Remove any empty rows or columns Word added, and fix merged cells or line breaks. This makes the Markdown output match your sheet.
- Save the document as .docx. Keeping the file as Word format preserves the table structure, so you can reopen it later if you need to change a value.
- Write the Markdown rows. Put one row per line, with cells separated by pipes. For example, a three-column table looks like
| Item | Qty | Price |on the first line. For the formula method, a helper formula in the cell next to each row can join the values with" | "and wrap them with a leading and trailing pipe. - Add the separator row. Directly below the header row, write one set of dashes for each column, such as
| --- | --- | --- |. Without this line, most Markdown renderers will not show the table. - Paste into your Markdown file and check the rendering. Open the file in the viewer you plan to use, such as a documentation site or a Markdown preview, and confirm the columns line up.
- Save the Markdown file as plain text. Use a .md extension, and check that the encoding is UTF-8 if your data includes accented characters or symbols.
Check the result
Once the Markdown is in place, run through these checks. Most problems show up in the first two.
| Check | How to see it | If it's wrong |
|---|---|---|
| Column count | Count the pipes in the header row and in one data row; they should match | Find the row with extra or missing pipes and fix the cell that split |
| Separator row | The line under the header has the same number of dash groups as the header has columns | Add or fix the separator row, using --- for each column |
| Pipes inside cells | Search the file for a pipe that is not a column divider | Replace the pipe in the source cell, then regenerate that row |
| Line breaks | Each table row sits on a single line | Join the cell text into one line, or move the extra text into a note below the table |
| Numbers and dates | Compare a few values in the rendered table with the Excel sheet | Check whether the paste carried formulas instead of values, and recopy the displayed numbers |
If the table renders as plain text, the separator row or the leading and trailing pipes are the usual cause. Open the raw Markdown and compare it with the example above before you change anything else.
Machine-assisted conversion can introduce small errors, so check any figures, names or dates against the original sheet before you publish the Markdown.
❓ FAQ
1. Can I convert an Excel file straight to Markdown without a Word step?
Yes, for small grids with no line breaks or merged cells. Build each row with a formula that joins the cell values with pipes, then paste the rows into a text file and add the separator row. The Word route is better when cells are long or irregular, because Word shows the cell boundaries clearly.
2. Is there an online option for Excel to Markdown table conversion?
Online converters exist, but check a few things before you upload data. Look at file size limits, whether the header row and column count survive, and how the site handles your files. For sensitive figures, the formula method keeps everything on your own computer.
3. How do I keep a Markdown table readable when a cell has a long sentence?
Shorten the text in the cell, or move the detail into a sentence below the table. Long cells make the raw Markdown hard to scan, even when the rendered table looks fine. Keep each row on one line so the next editor can see the structure at a glance.
📝 Summary
Converting an Excel table to a Markdown table comes down to clean structure: one header row, a separator row and the same number of cells in every row. For simple sheets, a formula and a text file are enough, and for messier ones, a Word table makes line breaks and merged cells easier to fix. Run the column and rendering checks before you publish, and you will avoid most broken tables.


