Markdown tables are good for README files, documentation, blogs, wikis and knowledge bases. This tool changes table data into Markdown syntax. You can use the result on GitHub, on documentation platforms and in Markdown editors that show tables.
Convert Your Table to Markdown
Paste your table into the box above. The tool accepts these formats:
- Cells that you copy from Excel, Google Sheets or Word.
- A table that you copy from a web page.
- Tab-separated values (TSV), CSV, semicolon-separated values and JSON.
- An existing Markdown table that you want to clean.
You can also click Upload file to open an .xlsx, .xls, .ods, .csv, .json or .html file. The badge below the box shows the format that the tool found, and the number of rows and columns.
Input (cells copied from a spreadsheet):
Name Department Status
Ana Editorial Active
Luis Engineering Pending
Output:
| Name | Department | Status |
| ---- | ----------- | ------- |
| Ana | Editorial | Active |
| Luis | Engineering | Pending |
The tool adds spaces so that the columns align in plain text. To get a compact table without these spaces, open More options and turn off Neat columns. Click Copy Markdown to copy the table, or Download .md to save the table.md file.
What Is a Markdown Table?
A Markdown table is plain text that a Markdown program shows as a table. It has three parts:
- The header row: the first row. It contains the column names.
- The separator row: the second row. It contains hyphens (
---) between pipe characters. - The body rows: all other rows. Each row contains one record.
Pipe characters (|) separate the columns. For simple data, a Markdown table is easier to read and change than an HTML table. You can read a Markdown table even when the program does not show it as a table.
How to Create a Markdown Table
Add the column headings
Write the column names in the first row. Each name identifies one field, for example Name or Price. If your first row is data and not names, turn off First row is header. Then the tool writes Column 1, Column 2 as headings.
Add the separator row
Put a row of hyphens below the headings. Put a pipe character between the hyphens for each column: | --- | --- |. The tool adds this row for you.
Add the table data
Write one record on each row below the separator row. Use the same number of cells in each row as in the header row.
Copy the generated Markdown
Click Copy Markdown. Then paste the table into a GitHub README, a .md file, a CMS editor or a documentation tool.
Markdown Table Syntax Example
| Feature | Supported |
| ------------- | --------- |
| Copy output | Yes |
| Download file | Yes |
- The pipe character (
|) separates the columns. - The first row contains the headers.
- The second row separates the headers from the data.
- Each row after the second row contains table data.
Markdown Table Alignment
Colons in the separator row set the alignment of each column:
| Item | Left aligned | Center aligned | Right aligned |
| :------ | :----------- | :------------: | ------------: |
| Example | Text | Text | 25.00 |
:---aligns text to the left.:---:centers the text.---:aligns text to the right.
A separator without colons (---) also aligns text to the left in most Markdown programs. This tool writes --- for left alignment. To set the alignment for all columns, click Left, Center or Right. To set the alignment for one column, click the icon in the header of that column in the preview. Right alignment is good for prices and other numbers.
Where to Use Markdown Tables
- GitHub README files
- Technical documentation
- Developer wikis
- Blog posts
- Product comparisons
- Feature lists
- Content briefs
- Project notes
- Knowledge bases
Common Markdown Table Problems
- Missing separator row. Without the
| --- |row, Markdown programs show the text as plain lines. The tool always adds the separator row. - Different numbers of columns in each row. The tool adds empty cells to short rows, so all rows have the same number of columns.
- Unescaped pipe symbols. A pipe in a cell starts a new column. The tool writes a pipe in a cell as
\|. - Long text inside cells. Long text makes the table wide and difficult to read. Put long text below the table and keep the cell short.
- Unsupported HTML or rich formatting. Markdown tables cannot contain merged cells, colors or lists. The tool keeps the text and adds empty cells where cells were merged.
- Inconsistent spacing. The spaces in a Markdown table do not change how the table shows. Neat columns aligns the columns so that the plain text is easy to read.
- Line breaks inside table cells. A Markdown cell cannot contain a line break. The tool changes each line break in a cell to
<br>. - Markdown tables that do not show on every platform. Tables are part of GitHub Flavored Markdown. Some Markdown programs do not show tables. If the table does not show, make sure that the program supports GitHub Flavored Markdown tables.
Markdown Table vs HTML Table
| Markdown table | HTML table |
|---|---|
| Faster to write | Gives more control of the layout |
| Easy to read in plain text | Supports more advanced styles |
| Good for documentation | Better for complex web layouts |
| Needs a program that supports Markdown | Needs a program that shows HTML |
Convert a table to Markdown with code
If you use pandas in Python, to_markdown() makes a Markdown table. This function needs the tabulate package. To read .xlsx files, read_excel() needs the openpyxl package.
pip install pandas tabulate openpyxl
import pandas as pd
df = pd.read_excel("report.xlsx")
print(df.to_markdown(index=False))
More Free Data and Text Tools
- Markdown to CSV converter: change a Markdown table back into CSV for a spreadsheet.
- CSV to JSONL converter: change CSV rows into JSON Lines.
- SEO slug generator: make clean URL slugs from titles.
- Text cleaner: remove extra spaces and unwanted characters from text.
The tool works in your browser. Your table does not go to a server.
Paste your table data above and generate clean Markdown in seconds.