Copy a table from Excel or Google Sheets and paste it into the text box below to create a Markdown table. This online tool is made possible by Jonathan Hoyt’s innovative copy-excel-paste-markdown code. I’ve also modified his code to create a version that supports column alignments as explained below. Here are the steps:
- In Excel or Google Sheets, select a range of cells and press Ctrl+C to copy.
- Paste (Ctrl+V) into the text box below to create a Markdown table.
- If your table is wide, the resulting text in the text box will appear to be wrapped and misaligned; however, everything will align properly when you copy it from the text box and paste it into your Markdown editor/text editor.
- I have written an article on using Markdown with Visual Studio Code if you are looking for a good Markdown editor.
You can optionally specify column alignment information by prepending one of the following to the column heading names in Excel:
- ^c – center alignment
- ^r – right alignment
- ^l – left alignment (the default)
For example: enter the following in Excel to right-align the second column and center-align the third column:
This will produce the following markdown table when pasted:
| animal | weight | color | |--------|-------:|:------:| | dog | 30lb | tan | | dog | 85lb | black | | cat | 18lb | calico |
Follow @thisDaveJ (Dave Johnson) on Twitter to stay up to date with the latest tutorials and tech articles.