# Markdown Table Converter (CSV, JSON, HTML) (`plainpipe/markdown-table-converter`) Actor

Convert tables between CSV, TSV, JSON, Markdown and HTML from text, links or an upload. Use when you need a table in another format, e.g. HTML tables to CSV.

- **URL**: https://apify.com/plainpipe/markdown-table-converter.md
- **Developed by:** [Plain Pipe](https://apify.com/plainpipe) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Markdown Table Converter (CSV, JSON, HTML)

Convert tables between CSV, TSV, JSON, Markdown and HTML from pasted text, file links or an upload. One result per table with headers and converted text.

**Use this when:** you have a table in one format (CSV, TSV, JSON, Markdown or HTML) and need it in another, or need every table from an HTML page.

### Why this one

- $0.50 per 1,000 results, one result per converted table.
- Each result includes `headers`, `rows`, `columns`, `caption` and `tableIndex` next to the converted `output`, so you can check the shape before using it.
- Input format is auto-detected; every `<table>` on an HTML page can be converted in one run. No browser, no proxy.
- The prefilled example finishes in under 3 seconds in our test runs; 6 edge-case inputs are checked before each release.

### What it does

Give it a table in one format and it returns the same table in another. It reads CSV, TSV, JSON arrays, Markdown pipe tables and HTML `<table>` elements, and writes Markdown, CSV, TSV, JSON or HTML.

Every table found in the input becomes one result. A Markdown file with three tables gives three results; an HTML page with five `<table>` elements gives five (or only the first, if you turn that option off). CSV and TSV are parsed with the open-source papaparse library, so quoted fields with commas or line breaks inside are handled, and in auto mode the delimiter is guessed (semicolon-separated files work too). HTML tables are read by a small built-in reader that understands `thead`/`tbody`, `th`/`td`, `colspan`, `rowspan`, `<br>` line breaks and `<caption>`. Unicode text (accents, Cyrillic, CJK) is kept as is.

### Use cases

- Turn a spreadsheet export (CSV) into a Markdown table for documentation or a README.
- Pull the tables out of an HTML page into CSV or JSON for analysis.
- Turn a JSON API response into a readable table for a changelog or wiki page.
- Convert Markdown tables from docs back into CSV for a spreadsheet.
- Convert the same set of files on a schedule and send the output on through the Apify API.

### How to use it

1. Paste a table into **Table text**, or add raw file links to **File URLs**, or upload a file.
2. Pick the **Output format** (Markdown by default). Leave **Input format** on Auto unless detection guesses wrong.
3. Click **Start**. Each table appears as one row in the dataset; the converted table is in its `output` field, ready to copy.
4. Export the rows as JSON, CSV or Excel, or read them through the Apify API.

### Input

| Field | What it is | Default | Example |
|---|---|---|---|
| `inputText` | A table pasted as text (CSV, TSV, JSON, Markdown or HTML). Read as source `text`. | a small sample CSV | `Plan,Price` on line 1, `Free,0` on line 2 |
| `inputUrls` | Links that point straight at raw files (CSV, TSV, JSON, Markdown, or an HTML page that contains tables), one per line. | none | `["https://www.w3.org/WAI/tutorials/tables/two-headers/"]` |
| `inputFile` | One uploaded file, instead of or in addition to the other inputs. | none | a file picked in the input form |
| `inputFormat` | `auto`, `csv`, `tsv`, `json`, `markdown` or `html`. Auto checks the content per source: valid JSON, then `<table>` tags, then a Markdown separator line (`\|---\|---\|`), then tabs versus commas. | `auto` | `csv` |
| `outputFormat` | `markdown`, `csv`, `json`, `html` or `tsv`. | `markdown` | `csv` |
| `headerRow` | The first row holds column names. Off: every row is data, columns are named `column_1`, `column_2` and so on, CSV, TSV and HTML output has no header row, and JSON output becomes an array of arrays. | `true` | `false` |
| `alignNumbersRight` | Right-align all-number columns in Markdown (`---:`) and HTML (inline style) output. | `true` | `false` |
| `escapePipes` | Write `\|` inside a cell as `\\|` in Markdown output so the table does not break. | `true` | `false` |
| `extractAllHtmlTables` | For HTML input, convert every `<table>`. Off converts only the first table of each source. | `true` | `false` |
| `maxItems` | Stop after this many converted tables in total. | `100` | `10` |

### Output

One dataset row per table. Real output of the prefilled input (a small pasted CSV converted to Markdown):

```json
{
  "source": "text",
  "tableIndex": 0,
  "inputFormat": "csv",
  "outputFormat": "markdown",
  "rows": 3,
  "columns": 4,
  "headers": ["Plan", "Price (USD)", "Runs per month", "Support"],
  "caption": null,
  "output": "| Plan    | Price (USD) | Runs per month | Support   |\n| ------- | ----------: | -------------: | --------- |\n| Free    |           0 |            100 | Community |\n| Starter |          49 |           5000 | Standard  |\n| Scale   |         499 |          50000 | Priority  |"
}
```

| Field | Meaning |
|---|---|
| `source` | `text`, or the link the table came from. |
| `tableIndex` | Counts tables within one source, from 0. |
| `inputFormat` / `outputFormat` | The format that was detected or chosen, and the target format. |
| `rows` / `columns` | Data rows (the header row is not counted) and columns. |
| `headers` | Column names. Empty or repeated names are made unique (`column_3`, `Name_2`). |
| `caption` | The HTML `<caption>` text, or `null`. |
| `output` | The converted table as text. |

### Pricing

Pay per result: **$0.50 per 1,000 results** ($0.0005 per result). One result is one converted table. You only pay for tables the Actor returns. Set a maximum total charge on the run to cap your spend.

### Limits

- Files up to 20 MB each, UTF-8 text. Links must point straight at the file or page, not at a viewer that loads it with scripts; pages that build their tables in the browser with JavaScript are not rendered. Redirects are followed.
- Excel `.xlsx` files are not read; save them as CSV first.
- Cell values are kept as text. Formatting inside cells (bold, links, images) is reduced to plain text when reading HTML, and Markdown inline formatting is kept as written.
- JSON input must be an array of objects, an array of arrays, or an object whose first array value is one of those. Nested values are written as JSON text in one cell; they are not flattened.
- In HTML, a cell that spans several columns keeps its value in the first column and leaves the others empty; a cell that spans several rows repeats its value down. Nested tables are returned as separate tables.
- Rows shorter than the widest row are padded with empty cells.
- Sources that cannot be fetched or hold no table are skipped with a warning; if no table is found at all the run fails and nothing is charged.

### FAQ

**How much does it cost?**
One result per converted table. 1,000 tables cost $0.50. Sources without a table are not charged.

**Why was my source skipped with "no table found"?**
Auto detection read it as a different format, or the table has no data rows. Set **Input format** to the real format, and check that the table has a header and at least one row.

**Can it read an HTML page with several tables?**
Yes. Each `<table>` becomes one result, with `tableIndex` and `caption`. Turn off **Convert every HTML table** to get only the first one.

**Can I convert Excel files?**
Not directly. Save the sheet as CSV and give that file or paste its content.

**Can I run it on a schedule or from my own code?**
Yes. Use Apify schedules for recurring runs, or start runs and read the dataset through the Apify API, the JavaScript or Python client, or integrations such as Make, Zapier and webhooks.

### Legal and data

This Actor processes only what you give it or public, non-personal technical data. It does not log in anywhere, does not collect personal data, and does not bypass paywalls, CAPTCHAs or access controls. You are responsible for having the right to process the inputs you provide.

### Support

Open an issue on the Issues tab. Issues are answered within 14 days. Please include the run ID and, if you can, a sample of the table that gave the wrong result.

Other Plain Pipe document tools: PDF to Markdown Converter, DOCX to Markdown & Text Converter, EPUB to Markdown & Text Converter, PDF Merge & Split Tool, PDF Watermark & Page Number Tool, Markdown to HTML Converter.

Built and maintained by Plain Pipe.

# Actor input Schema

## `inputText` (type: `string`):

Paste a table here: CSV, TSV, a JSON array, a Markdown table or HTML with <table> elements. It is read as source "text". Example: Plan,Price on the first line, then Free,0.

## `inputUrls` (type: `array`):

Links that point straight at raw files (CSV, TSV, JSON, Markdown or an HTML page with tables), one per line. Each table found becomes one result. Example: https://www.w3.org/WAI/tutorials/tables/two-headers/.

## `inputFile` (type: `string`):

Or upload one CSV, TSV, JSON, Markdown or HTML file from your computer. Up to 20 MB.

## `inputFormat` (type: `string`):

Format of the input. Default auto: detected per source from the content (and the file extension for CSV/TSV). Set it if detection guesses wrong, for example csv for a file without an extension.

## `outputFormat` (type: `string`):

Format to convert every table to. Default markdown. Example: csv to pull HTML tables into a spreadsheet.

## `headerRow` (type: `boolean`):

Treat the first row of each table as column names. Default on. Turn off to read every row as data; columns are then named column_1, column_2 and so on, and CSV/TSV/HTML output has no header row.

## `alignNumbersRight` (type: `boolean`):

In Markdown (and HTML) output, right-align columns whose values are all numbers. Default on.

## `escapePipes` (type: `boolean`):

In Markdown output, write a | inside a cell as | so the table layout does not break. Default on.

## `extractAllHtmlTables` (type: `boolean`):

When the input is HTML, convert every <table> on the page (one result each). Default on. Turn off to convert only the first one.

## `maxItems` (type: `integer`):

Stop after this many converted tables in total. You are charged per converted table. Default 100. Example: 10.

## Actor input object example

```json
{
  "inputText": "Plan,Price (USD),Runs per month,Support\nFree,0,100,Community\nStarter,49,5000,Standard\nScale,499,50000,Priority",
  "inputUrls": [],
  "inputFormat": "auto",
  "outputFormat": "markdown",
  "headerRow": true,
  "alignNumbersRight": true,
  "escapePipes": true,
  "extractAllHtmlTables": true,
  "maxItems": 10
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "inputText": `Plan,Price (USD),Runs per month,Support
Free,0,100,Community
Starter,49,5000,Standard
Scale,499,50000,Priority`,
    "inputUrls": [],
    "outputFormat": "markdown",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("plainpipe/markdown-table-converter").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "inputText": """Plan,Price (USD),Runs per month,Support
Free,0,100,Community
Starter,49,5000,Standard
Scale,499,50000,Priority""",
    "inputUrls": [],
    "outputFormat": "markdown",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("plainpipe/markdown-table-converter").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "inputText": "Plan,Price (USD),Runs per month,Support\\nFree,0,100,Community\\nStarter,49,5000,Standard\\nScale,499,50000,Priority",
  "inputUrls": [],
  "outputFormat": "markdown",
  "maxItems": 10
}' |
apify call plainpipe/markdown-table-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,plainpipe/markdown-table-converter"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/hivgOlkKbTUHGnYYM/builds/mcCfdMhmi6EvIswKc/openapi.json
