Shard Tools

JSON to Markdown Table

Turn a JSON array into a Markdown table in your browser, with pipes escaped so columns stay intact.

Maintained by Roshan.

Use JSON to Markdown Table

Converts JSON array of objects into Markdown table in this tab. Configuration files routinely hold hostnames, keys and credentials, so nothing here is sent anywhere.

Values are never retyped as numbers or booleansGuessing types is how a converter turns a postcode of 0123 into 123, or a literal string of false into a boolean. Values are carried across as they were written, and casting is left to you where it matters.

Explore developer and data tools

Find related browser-local tools for nearby tasks without starting another search.

Browse all developer and data tools

About JSON to Markdown Table

Markdown tables are painful to write and easy to break, which is why they are usually generated rather than typed. The syntax is unforgiving in one specific way: the pipe character separates columns, so a pipe appearing inside a value ends that cell early and shifts everything after it. A single unescaped pipe in one row misaligns the entire table below it, and because Markdown fails silently rather than raising an error, the damage is often noticed only after the document is published. The same applies to a newline inside a value, which ends the row entirely. Both are handled here. The output is a standard table with a header and separator row, which is the form GitHub, GitLab and most documentation tools understand.

Work through the input

  1. The union of keys across every object becomes the header row, followed by the separator row of dashes that Markdown requires to recognise a table at all.
  2. Each object becomes one row with cells in consistent column order.
  3. Pipe characters inside values are escaped with a backslash, so a value containing one does not end its cell and shift the row.
  4. Newlines inside values are replaced with spaces, because a Markdown table row must occupy a single line and a line break would end the row.
  5. Nested objects and arrays are written as compact JSON, which at least keeps them on one line and legible.

When json to markdown table is useful

A comparison table in a README

Express the rows as JSON and generate the table rather than aligning pipes by hand, which is where mistakes creep in.

Documenting an API response

Convert a sample response into a table for the docs. Nested fields become JSON text, which is usually clear enough in that context.

Check the output

Questions about JSON to Markdown Table

What happens to a pipe in my data?

It is escaped with a backslash. Left alone it would end the cell early and misalign every row below it.

Why is the source not aligned into neat columns?

Because rendered output is identical either way, and padded source produces noisy diffs in version control.

Can I control column alignment?

Not from here. Edit the separator row afterwards, using colons to mark left, right or centre.

What about multi-line values?

Newlines become spaces. A Markdown table row has to stay on one line.

Related tools

JSON to HTML Table

Turn a JSON array into a clean HTML table in your browser, with markup in the data escaped safely.

CSV to JSON Converter

Convert CSV to a JSON array locally. Parse quoted commas, embedded newlines, BOM files, duplicate headers, sparse rows, and optional safe value types.

Markdown to PDF

Convert Markdown into a paginated PDF with headings, lists and code blocks laid out as real text. Runs in your browser.