Skip to content

MediaWiki table generator

Build a wikitext table for Wikipedia, Fandom or any MediaWiki site. It is sortable by default, with the wikitable styling, a caption and alignment, and pipes escaped for you.

Loading the table editor… It runs locally in your browser.

Wikitext table syntax

{| class="wikitable sortable"
|+ Caption
|-
! Header 1 !! Header 2
|-
| cell || cell
|}

The markup is described in the MediaWiki Help:Tables documentation. {| opens the table, |- starts a row, and ! and | start header and data cells.

Alignment

Set a column to center or right in the grid and each of its cells gets style="text-align:right" |, which works on every MediaWiki skin without extra templates.

Going the other way

Need the data back out of a wiki? Copy the rendered table from the page and paste it into the CSV viewer, or save the page source and use HTML table to CSV.

Questions people ask

What is MediaWiki table syntax?

Wikitext tables start with {| and end with |}. |- starts a new row, ! marks header cells, | marks data cells, and !! or || put several cells on one line. |+ adds a caption. Wikipedia, Fandom and any MediaWiki-based wiki use it.

How do I make a Wikipedia table sortable?

Add the sortable class next to wikitable: {| class="wikitable sortable". Readers can then click any column header to sort. The generator adds it when “Sortable columns” is ticked.

How do I put a pipe character in a wiki table cell?

Write {{!}} instead of |, because a bare pipe starts a new cell. The generator escapes pipes in your text automatically. Line breaks become <br />.

Can I convert an Excel sheet to a wiki table?

Yes. Copy the cells in Excel or Google Sheets, press “Import data”, paste, and the wikitext is generated. You can also paste CSV or a Markdown table.

Other table generators