# Convert CSV to a Markdown table

Paste CSV and get a GitHub-flavored Markdown table back, ready for a README, a pull request, a wiki page or a prompt. Pipe characters inside your data are escaped so the table cannot silently break.

*Last updated: 2026-07-14 · Source: <https://pastesheet.com/tools/csv-to-markdown-table>*

## Using this without the browser

This page hosts an interactive tool: at <https://pastesheet.com/tools/csv-to-markdown-table> you paste a Google Sheet URL and it returns the result in the page. There is nothing to install and no account required.

If you are an agent or a script and need this programmatically instead, connect the sheet once as a PasteSheet endpoint and read it over HTTP — the endpoint returns the same rows as JSON, stays in sync with the sheet, and needs no Google credentials:

```bash
curl 'https://pastesheet.com/api/your-endpoint-id?limit=10'
```

The same endpoint is also a read-only MCP server at `https://pastesheet.com/mcp/sheets/your-endpoint-id`, exposing `list_tabs`, `get_schema` and `query_rows`. See <https://pastesheet.com/guides/google-sheets-mcp.md>.

## What the output looks like

The header row becomes the table header, and the output is [GitHub-flavored Markdown](https://github.github.com/gfm/#tables-extension-), which renders on GitHub, GitLab, Notion, Obsidian and most static-site generators:

```bash
| name | role |
| --- | --- |
| Ada Lovelace | Engineer |
| Grace Hopper | Admiral |
```

## Pipes are escaped, newlines are collapsed

A literal `|` in a cell ends the column early, so the table renders with the wrong number of columns from that row down — and it does it silently, which is why this is the classic bug in hand-rolled converters. Every pipe in your data is escaped to `\|`.

Newlines inside a quoted CSV field are collapsed to spaces, because a Markdown table row cannot span lines. Nothing else about your values is touched.

## If the CSV came from a Google Sheet

Skip the export. [Paste the sheet URL directly](https://pastesheet.com/tools/google-sheets-to-markdown) and get the Markdown table without downloading a file first.

## Frequently asked questions

### What happens to a pipe character in my data?

It is escaped to \| so it cannot break the table. An unescaped pipe inside a cell terminates the column early and silently corrupts every row after it, which is the single most common bug in hand-rolled Markdown table converters.

### Will the table render on GitHub?

Yes. The output follows the GitHub Flavored Markdown table extension, which GitLab, Notion, Obsidian and most static-site generators also implement. Paste it into a README or a pull request description and it renders as a table.

### What about newlines inside a cell?

They are collapsed to spaces. A Markdown table row has to live on a single line, so a multi-line cell has no representation — collapsing keeps the content while preserving the table, which is the least-bad option available.

## Sources

- [GitHub Flavored Markdown Spec — Tables](https://github.github.com/gfm/#tables-extension-) — GitHub
- [RFC 4180 — Common Format and MIME Type for CSV Files](https://www.rfc-editor.org/rfc/rfc4180) — IETF

## Related tools

- [Free CSV to JSON Converter Online](https://pastesheet.com/tools/csv-to-json) — Paste CSV and get formatted JSON back — one object per row, keyed by the header row. Quoted fields, embedded commas and newlines all handled. Free, no signup.
- [Google Sheets to Markdown Table Converter](https://pastesheet.com/tools/google-sheets-to-markdown) — Turn a Google Sheet into a Markdown table for a README, a doc, or an AI prompt. Free, instant, no signup — pipes inside your cells are escaped for you.
- [Free JSON to CSV Converter Online](https://pastesheet.com/tools/json-to-csv) — Paste a JSON array of objects and get CSV back, header row built from the keys. Values holding commas or quotes are escaped properly. Free, no signup.

---

[PasteSheet](https://pastesheet.com) turns any Google Sheet into a live REST API and MCP server for AI agents — no backend, no code. Canonical HTML version of this page: <https://pastesheet.com/tools/csv-to-markdown-table>
