# How I turn terminal tables into Markdown or CSV

A beginner-friendly guide to converting aligned CLI output like docker ps or df into Markdown tables, CSV, or TSV.

- Date: 2026-09-27
- URL: https://ilham.dev/posts/how-to-turn-terminal-tables-into-markdown-or-csv/
- Markdown: https://ilham.dev/posts/how-to-turn-terminal-tables-into-markdown-or-csv/index.md
- Tags: cli, markdown, csv, tools
- Reading time: 2 min


Terminal output is readable to humans, but often awkward to paste into docs, spreadsheets, or issue reports.

The [CLI Table Converter](/tools/cli-table-converter/) tool helps me inspect the input and output without writing a one-off script first.

## The simple idea

Terminal output is readable to humans, but often awkward to paste into docs, spreadsheets, or issue reports.

I use it to answer one focused question at a time, then I review the result before using it anywhere important.

## Step 1: Paste aligned terminal output

Paste aligned terminal output.

## Step 2: Check whether columns are detected correctly

Check whether columns are detected correctly.

## Step 3: Choose Markdown, CSV, or TSV output

Choose Markdown, CSV, or TSV output.

## Step 4: Review long cells that may contain spaces

Review long cells that may contain spaces.

## Step 5: Clean sensitive hostnames, IDs, or paths before sharing

Clean sensitive hostnames, IDs, or paths before sharing.

## Step 6: Paste Markdown into docs or CSV into spreadsheets

Paste Markdown into docs or CSV into spreadsheets.

## Step 7: For scripts, prefer structured output when the command supports it

For scripts, prefer structured output when the command supports it.

## My checklist

Before I trust the result, I check:

- Paste aligned terminal output.
- Check whether columns are detected correctly.
- Choose Markdown, CSV, or TSV output.
- Review long cells that may contain spaces.
- Clean sensitive hostnames, IDs, or paths before sharing.
- Paste Markdown into docs or CSV into spreadsheets.
- For scripts, prefer structured output when the command supports it.

The tool makes the mechanical part faster. The decision still belongs to me: is this result correct, safe, and appropriate for the real task?
