# CSV to markdown table

`csv-to-markdown-table` · version 1.0.0 · CSV & tables · free, no key needed

Render ASCII CSV with CRLF records as Markdown; rejects LF-only records and non-ASCII text.

**Use when you need to: turn CSV into a Markdown table · render comma separated data for GitHub · convert CSV rows to GFM table syntax.**

## Decide before calling

Read the [versioned contract](/v1/tools/csv-to-markdown-table/versions/1.0.0) and the supported scope below. Reuse `csv-to-markdown-table@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `csv-to-markdown-table@1.0.0` for turn CSV into a Markdown table. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- turn CSV into a Markdown table
- render comma separated data for GitHub
- convert CSV rows to GFM table syntax
- escape pipes in a Markdown table
- align Markdown table columns
- make a Markdown table from CSV text

## Not supported

- HTML table output
- Markdown parsing
- automatic numeric alignment

## Behavior

- CSV parsing follows RFC 4180; the first record becomes the table header.
- Pipe and backslash characters are backslash-escaped; embedded CRLF becomes <br>.
- Omitted alignments default every column to left. Output follows GFM 0.29 tables extension delimiter-row syntax.

## Input

- `csv` (string, required): min length 1; max length 16384
- `alignments` (array of one of "left", "center", "right", optional): max items 32

## Output

- `markdown` (string, required): max length 32768
- `rows` (integer, required): min 0; max 255
- `columns` (integer, required): min 1; max 32
- `standard_version` (constant "RFC 4180 (October 2005)", required)

## Limits

- max input bytes: 16384
- max rows: 256
- max columns: 32
- max iterations: 16384
- max output bytes: 32768

## Example

Request input:

```json
{
  "csv": "name,note\r\nAda,\"x|y\""
}
```

Response:

```json
{
  "result": {
    "markdown": "| name | note |\n| :--- | :--- |\n| Ada | x\\|y |",
    "rows": 1,
    "columns": 2,
    "standard_version": "RFC 4180 (October 2005)"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "csv-to-markdown-table",
  "version": "1.0.0",
  "input": {
    "csv": "name,note\r\nAda,\"x|y\""
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/csv-to-markdown-table/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"csv":"name,note\r\nAda,\"x|y\""}'
```

The machine-readable contract is at [/v1/tools/csv-to-markdown-table/versions/1.0.0](/v1/tools/csv-to-markdown-table/versions/1.0.0).

### CLI

```sh
node cli.mjs run csv-to-markdown-table 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [CSV filter pattern literal](/tools/csv-filter-pattern-literal): Filter ASCII CSV with literal contains/starts-with; requires CRLF records, rejects LF-only and non-ASCII input.
- [CSV filter compare](/tools/csv-filter-compare): Filter ASCII CSV rows by string/decimal comparison; requires CRLF records, rejects LF-only and non-ASCII input.
- [CSV dialect format](/tools/csv-dialect-format): Format string rows as CSV for an explicit dialect, quoting a one-field empty record when it can.
- [Table count distinct check](/tools/table-count-distinct-check): Check a claimed COUNT(DISTINCT) and optional distinct-value list over JSON rows; returns the first mismatch.
- [CSV dialect parse](/tools/csv-dialect-parse): Parse CSV with an explicit dialect into string rows, keeping leading zeros and embedded breaks.
- [Table aggregate check](/tools/table-aggregate-check): Check claimed COUNT/SUM/AVG/MIN/MAX results over JSON rows exactly (SQL nulls); returns the first mismatch.
