Need AI Training/Help?CloudYeti.io/meet
MarkdownMe
Excel to Markdown guide

Fix Pipe Characters That Break a Markdown Table

A literal | inside a cell starts a new column and breaks the table. Escape it as \| so the renderer prints the character instead of splitting the row.

Direct answer

In a Markdown table the pipe character separates columns, so a pipe inside cell text splits that row into extra columns. Escape it with a backslash: write `\|` instead of `|`. The converter above does this for every cell when the 'Escape pipe characters' option is on, so pasted values such as `a|b` survive as text.

Open Excel to Markdown converter

When to use this

  • One row in a rendered table has more columns than the others.
  • Cells hold shell commands, regular expressions, or union types that contain pipes.
  • Copied spreadsheet values include a pipe as a separator inside a single cell.

Steps

  1. Paste the cells into the converter above.
  2. Leave 'Escape pipe characters in cells' on.
  3. Look at the live output and confirm each row has the same number of columns.
  4. Press Copy and paste the table into your document.
  5. Preview the rendered table to confirm the pipe now prints as a character.

Example conversion

Spreadsheet cells (tab-separated)
Command	Meaning
ls | wc -l	Count files
grep a|b	Match a or b
Markdown table output
| Command | Meaning |
| --- | --- |
| ls \| wc -l | Count files |
| grep a\|b | Match a or b |

Common mistakes

  • Do not wrap the cell in backticks and expect the pipe to be safe. Inline code does not stop a table row from splitting; the backslash escape is still required.
  • Do not escape pipes twice. `\\|` prints a backslash followed by a broken column.
  • Line breaks inside a cell also break tables. Replace them with `<br>` or remove them before converting.

FAQ

Why does a pipe inside backticks still break the table?
Table rows are split into cells before inline code is parsed, so the pipe is treated as a column separator first. Escaping with a backslash is the fix that works in GitHub Flavored Markdown.
Should I escape every pipe in the document?
Only pipes inside table cells need escaping. Pipes in normal paragraphs or fenced code blocks are safe as-is.
Does the converter escape anything else?
It escapes pipe characters and it collapses line breaks inside a cell so each row stays on one line. Other Markdown characters are left as typed.

Related Excel to Markdown guides