Excel Table to Markdown: Ways to Convert and Format

How-to basics · Updated November 18, 2026

Excel has no built-in command that exports a range or table directly as Markdown. To convert one, copy the data into a Markdown table structure, or use a formula to build the pipe-delimited text in a worksheet; then check the result in a Markdown renderer before sharing it.

What an Excel table looks like in Markdown

An Excel table is a grid of cells, with features such as a header row, filters, and cell formatting. A Markdown table is plain text that uses vertical bars to separate columns and a row of hyphens beneath the headings. For example, a small table might be written like this:

| Item | Qty | Note |
| --- | --- | --- |
| Apples | 3 | Fresh |
| Tea | 1 | Loose-leaf |

The first line supplies the column names. The second line marks the header and can also specify alignment. The remaining lines contain the data. Markdown does not carry over Excel’s fill colors, borders, fonts, filters, formulas, or interactive table features. It carries text and a basic table structure, with rendering determined by the Markdown platform.

Markdown table support is common, but not universal in every Markdown editor or publishing system. Some platforms also support extensions, such as alignment markers, that other renderers may handle differently. If a table will be read in a particular wiki, repository, or content system, preview it there rather than assuming every renderer displays it identically.

Choose a conversion method

The best approach depends on the table’s size, how often it changes, and whether its data is private. For a small, one-time table, manual conversion is straightforward. A worksheet formula can create repeatable text from a consistent layout. For a large dataset or a recurring publishing process, a script or an approved conversion tool may be more practical.

  • Manual editing: Suitable for a few rows when you want to review every value and remove columns that do not belong in the final table.
  • Worksheet formulas: Useful for small or medium tables with a stable number of columns. They keep the conversion visible in Excel, but need extra care with special characters and formatting.
  • A converter or script: Better for large or repeated jobs, provided the tool handles escaping and you can use it without exposing confidential data.
  • CSV export: A way to move plain data between applications, not a direct Markdown export. CSV still needs to be converted into Markdown syntax.

Before converting, decide whether the output needs every row and column. A spreadsheet may include helper columns, notes, totals, or internal identifiers that are useful in Excel but distracting in a published table.

Convert a small table by hand

For a short table, copy the content and write the Markdown header, separator, and data rows. In Excel for Microsoft 365 on Windows, select the cells and press Ctrl+C. Paste them into a plain-text editor to inspect the copied, tab-separated values, or paste into a Markdown editor and replace the tab-separated layout with pipes and the required separator row. Copying cells does not itself create Markdown.

On a Mac, use Command+C. If you paste into TextEdit, choose Format > Make Plain Text first if the document is in rich-text mode. Excel for the web can also copy selected cells, but the clipboard output is still cell data rather than a finished Markdown table. The exact paste result can depend on the destination application.

For the example above, put a pipe at the start and end of each line, separate each cell with a pipe, and add a line of hyphens under the header. Check that each row has the same number of columns. A blank cell is still a cell, so leave its position between two separators; deleting it can shift later values into the wrong columns.

Build Markdown rows with Excel formulas

For a repeatable conversion in Excel for Microsoft 365 on Windows, suppose the source range is A1:C4, with headings in A1:C1 and three data rows below. Set up a separate output column so the source remains unchanged. The formulas below produce one Markdown line per row, plus a separator line that you enter as text.

With the headings Item, Qty, and Note in A1:C1, enter this in D1. It returns | Item | Qty | Note |.

="| "&A1&" | "&B1&" | "&C1&" |"

Type | --- | --- | --- | into D2. With the first data row in A2:C2, enter this in D3. It returns | Apples | 3 | Fresh | for the example values. Copy D3 down through D5 to create a line for each remaining source row.

="| "&A2&" | "&B2&" | "&C2&" |"

With the completed Markdown lines in D1:D5, enter this in another cell, such as F1. It joins the five lines with line breaks to make a single Markdown block.

=TEXTJOIN(CHAR(10),TRUE,D1:D5)

Turn on Wrap Text for the output cell if the lines are difficult to inspect. The formula output is plain text; it will not render as a formatted table inside Excel. Copy the cell and paste its value into a Markdown editor or text file. TEXTJOIN is available in Microsoft 365 and newer Excel releases, including Excel 2019 and later.

Preserve values and handle special characters

Concatenating a cell into a text string can produce a different result from what Excel displays in the grid. A date may become its underlying serial number, and a number formatted with leading zeroes may lose those zeroes. If the Markdown needs a particular display, convert the value deliberately—for example, decide on a date format or treat an identifier as text before building the output. Review the generated text rather than assuming Excel’s visual formatting will carry across.

A vertical bar inside a cell is especially important because Markdown uses it as a column separator. In many Markdown table formats, a literal pipe inside a cell must be escaped with a backslash. A cell containing North | South may otherwise appear to create an extra column. Test the escape convention in the renderer you will use; Markdown implementations do not all handle every edge case the same way.

Line breaks inside a cell can also disrupt a simple one-line-per-row formula. Decide whether to replace them with spaces, preserve them using a renderer-supported line-break convention, or remove them. Likewise, trim accidental spaces and decide how to represent empty cells. These decisions are about the intended output, not just syntax: a clean conversion should preserve meaning as well as alignment.

Formatting, alignment, and table size

Markdown tables do not reproduce Excel’s visual styling, but separator rows can express basic horizontal alignment in many common renderers. A colon on the left indicates left alignment, a colon on the right indicates right alignment, and colons on both ends indicate centered alignment. For example, a separator cell written as :---: requests centered alignment where supported. Plain hyphens are the most portable choice when alignment is unnecessary.

Keep headings concise and use consistent units. If a column contains money, include a currency label in the heading or values; if it contains dates, use one clear date format. Consider rounding only when the rounded values remain truthful for the purpose of the table. Markdown is text, so it does not preserve number formats or Excel’s underlying numeric precision as visible styling.

Wide or very long tables can be hard to read in Markdown, especially on narrow screens. Consider splitting a broad table into related smaller tables, removing unneeded columns, or providing a link to the full spreadsheet when the audience needs all the detail. A Markdown table is not a substitute for a workbook when readers need sorting, filtering, formulas, or data entry.

CSV, Power Query, and other alternatives

Saving a worksheet as CSV creates comma-separated text, not Markdown. CSV is useful as an intermediate format because many tools can read it, but a Markdown conversion step still has to add the header separator and pipe syntax. CSV also has its own quoting rules for commas, quotes, and line breaks, so opening or processing it as plain text requires care.

Power Query can import, clean, and reshape data in Excel, which may help prepare a table before conversion. It does not provide a standard built-in command to export a query result as a Markdown table. Similarly, Excel’s Save As options do not include a native Markdown format. If a process runs regularly, a script or a vetted converter can automate the final formatting, but confirm its output against representative data before relying on it.

Copying data to an online converter can be convenient, but consider the contents first. Do not upload customer, employee, financial, health, or otherwise confidential data to a service unless your organization permits that use and the service’s handling is appropriate. For sensitive work, use an approved local tool or a formula-based workflow that keeps the data in the workbook.

Common conversion problems

  • The table displays as plain text: The destination may not support Markdown tables, or it may require a preview mode. Check the target platform’s Markdown documentation.
  • Columns appear shifted: Look for an unescaped pipe in a cell, a missing separator, or a row with too few or too many cells.
  • Dates or identifiers change: Excel may be contributing the stored value rather than the displayed formatting. Review the output and prepare those values as text in the intended format.
  • Line breaks split a row: A cell may contain an embedded line break. Replace or encode it in a way supported by the destination.
  • The table is difficult to read: Shorten labels, remove unnecessary columns, and preview the result at the width where readers will see it.

A frequent misconception is that converting an Excel table to Markdown preserves the appearance of the spreadsheet. It does not: the conversion transfers a basic grid structure and text, not Excel’s formatting or behavior. If those features matter, share the workbook or a rendered document instead of relying on Markdown alone.

Frequently Asked Questions

Can Excel export a table directly to Markdown?
No. Excel for Microsoft 365 does not have a built-in Markdown export format. You can assemble Markdown with formulas, edit it by hand, or use an appropriate external tool.

Does copying cells from Excel create a Markdown table?
No. Copying usually transfers cell contents in a tabular clipboard format. You still need to add Markdown’s pipes and header separator, or use a tool that converts the copied data.

Is CSV the same as Markdown?
No. CSV is a data interchange format that separates values with commas and uses quoting rules. Markdown tables use pipes and a header separator row. CSV can be an intermediate step, but it is not a Markdown table by itself.

How do I keep a pipe character inside a cell?
Escape it according to the Markdown renderer’s table syntax, commonly with a backslash, and preview the result in the destination. An unescaped pipe can be interpreted as a column boundary.

Will Markdown preserve Excel colors, formulas, or filters?
No. A Markdown table is text with basic table structure. It does not retain Excel cell colors, formulas, filters, or interactive features; provide the workbook separately if readers need them.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.