Markdown Table Parser

Parses an existing GitHub-Flavored Markdown pipe table back into structured data, either a JSON array of objects keyed by the header row or CSV rows, and reports each column's alignment from the separator row. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-26

Overview

Introduction

A Markdown pipe table is easy to read as source text, but its data is trapped in pipe-delimited syntax until something parses it back into rows and columns.

This tool reverses that: paste an existing Markdown table and get back a JSON array of objects or CSV rows, ready to use in a script, spreadsheet, or API request.

What Is Markdown Table Parser?

A parser for GitHub-Flavored Markdown pipe tables that turns the header row, the alignment/separator row, and the body rows into structured JSON or CSV.

It's whitespace-tolerant the same way real Markdown renderers are: optional leading/trailing pipes and cell padding don't affect the result.

How Markdown Table Parser Works

The input is split into lines; the first non-blank line becomes the header row and the second becomes the alignment/separator row, which must consist of dash sequences optionally flanked by colons for each column.

Each row is split on unescaped pipe characters, with \| unescaped back to a literal | and \\ back to \, then zipped against the header to build one record per row. The separator row's colon placement determines each column's reported alignment.

When To Use Markdown Table Parser

Use it when you have a Markdown table in a README, doc, or note and need the underlying data as JSON or CSV instead of retyping it.

It's also useful for validating that a hand-written or generated Markdown table has consistent column counts and a well-formed alignment row.

Features

Advantages

  • Whitespace-tolerant parsing, matching how real Markdown renderers read pipe tables.
  • Reverses pipe escaping (\|) back into a literal character automatically.
  • Reports per-column alignment (left, center, right, or none) detected from the separator row.
  • Toggle between JSON and CSV output without re-parsing by hand.

Limitations

  • Requires a standard single header row plus a valid separator row; multi-row or merged-cell headers aren't supported.
  • A <br> inserted by the Markdown Table Generator for embedded line breaks is kept as literal text rather than converted back into a newline, since <br> is also valid to type by hand.
  • Every row must have the same number of columns as the header; mismatched rows are reported as an error rather than padded or truncated.

Examples

Parsing a three-column table to JSON

Input

| Name  | Role   | Score |
| :---  | :---:  | ----: |
| Ada   | Admin  | 98    |
| Grace | Editor | 95    |

Output

[
  {
    "Name": "Ada",
    "Role": "Admin",
    "Score": "98"
  },
  {
    "Name": "Grace",
    "Role": "Editor",
    "Score": "95"
  }
]

The header row becomes object keys, and the separator row reports Name as left-aligned, Role as centered, and Score as right-aligned.

Best Practices & Notes

Best Practices

  • Pair with Markdown Table Generator to round-trip a table: generate it, edit the data as JSON or CSV elsewhere, then rebuild the Markdown.
  • Use Markdown Validator first if you're unsure whether a hand-written table is well-formed before parsing it here.
  • Switch to CSV output if you're pasting the result into a spreadsheet, since spreadsheet apps import CSV directly.

Developer Notes

Row splitting is a single-pass scan that treats \| and \\ as escape sequences before treating a bare | as a column boundary, which correctly reverses the escaping generateMarkdownTable applies, rather than a naive input.split("|") that would break on any literal pipe.

Markdown Table Parser Use Cases

  • Extracting the data behind a Markdown table in a README or wiki page into JSON for a script
  • Converting a Markdown comparison table into CSV for a spreadsheet
  • Checking a generated or hand-written table's column alignment and column-count consistency

Common Mistakes

  • Pasting a table with no separator row (just a header and data rows); GitHub-Flavored Markdown requires the --- row to recognize it as a table at all.
  • Assuming a mismatched column count in one row gets silently padded; it's reported as an error instead so bad data isn't hidden.

Tips

  • Upload a .md file directly instead of copy-pasting if the table lives in a larger document.
  • The alignment badges below the output reflect the separator row exactly as written, even if it doesn't match how the table is actually rendered elsewhere.

References

Frequently Asked Questions