Table converter

Convert tables between Excel, CSV, JSON, Markdown, HTML, SQL, LaTeX and ASCII.

Copy cells from Excel or Google Sheets, or paste CSV, TSV, JSON, Markdown, HTML, SQL INSERT, LaTeX or an ASCII table.

Table

4 rows × 3 columns

Paste a block of cells into any cell to fill the table from there.

ABC
1
2
3
4

Converted

What this tool does

It turns a table from one format into another without breaking it. Paste cells copied from Excel or Google Sheets (they arrive as tab-separated text), or a table written as CSV, JSON, a Markdown table, an HTML table, SQL INSERT statements, a LaTeX tabular or an ASCII box table. The format is detected for you. The data lands in an editable grid, where you can fix cells, sort, remove duplicates or transpose, and the result is written in the format you pick: CSV, TSV, JSON, Markdown, HTML, SQL INSERT, LaTeX or ASCII. Copy it or download it. Everything happens on this page.

How to use it

  1. Paste your table into the box at the top, or press Example. The note under it says which format it was read as; if the guess is wrong, choose the input format (and, for CSV, the delimiter) yourself.
  2. Check First row is the header. Formats that know about headers (JSON objects, Markdown, HTML <th>, SQL column lists, ASCII === lines, a LaTeX rule under the first row) set it automatically.
  3. Edit in the grid. Paste a block of cells from a spreadsheet into any cell and it fills the grid from there. Rows and columns have delete buttons; Add row and Add column grow the table.
  4. Tidy up: Sort by any column (numbers as numbers, text in your language's alphabetical order, empty cells last), Remove duplicates by whole row or by one column, Trim spaces, Remove empty rows, or Transpose rows and columns.
  5. Choose the output format, its options, and copy or download.

Nothing gets broken: quotes, commas, line breaks, Unicode

Most table conversions fail on the same cells: a comma inside a value, a quote, a line break typed with Alt+Enter in Excel, a pipe in a Markdown cell, an ampersand in LaTeX. Each format here has its own correct escape, applied in both directions:

Problem in a cellCSV / TSVMarkdownHTMLLaTeXSQL
Quote "doubled inside quotesas is&quot;as isas is (' is doubled)
Delimitercell quoteda pipe gets a backslashas is\& for &as is
Line breakinside quotes<br><br>\shortstackkept in the string

The tests convert a deliberately awkward table (quotes, commas, a line break, Vietnamese, Japanese and an emoji, empty cells, and every LaTeX special character) to all eight formats and read each back to exactly the same grid.

Format notes

  • CSV follows RFC 4180 with Windows line endings; choose comma, semicolon (what Excel uses in many European locales), tab or pipe. TSV is what spreadsheets copy and paste.
  • JSON writes an array of objects keyed by the header (repeated or blank header names get _2 or column_N), or arrays without a header. Values stay text unless you ask for numbers, true/false and null; long ids and numbers with leading zeros always stay text. Reading JSON flattens nested objects into dotted columns, using the same code as the CSV and JSON converter.
  • Markdown produces a GitHub-style table padded so the columns line up in plain text; a table without a header gets "Column 1, Column 2…" because Markdown requires one.
  • SQL writes multi-row INSERT statements (100 rows each) with identifiers and strings quoted for standard SQL, MySQL (backticks, backslashes doubled) or SQL Server (brackets, N'' strings). Empty cells can be NULL and numbers unquoted.
  • LaTeX writes a tabular with \hline rules and escapes \ & % $ # _ { } ~ ^. Reading also understands booktabs rules.
  • ASCII draws a +---+ box table that lines up in a monospace font, counting Chinese, Japanese and Korean characters and emoji as two columns wide.

The article on converting spreadsheet data without breaking it walks through the failures in detail. To clean a large CSV or JSON file rather than a table you can see, use the CSV and JSON converter; to write a whole document around the table, the Markdown editor.

Frequently asked questions

How do I convert an Excel table to Markdown?

Select the cells in Excel or Google Sheets, copy, and paste them into the box. They arrive as tab-separated text and are read automatically. Choose Markdown table as the output and copy the result.

Will commas, quotes and line breaks inside cells survive?

Yes. Each format uses its own escaping (quoted CSV fields, \| and <br> in Markdown, &quot; and <br> in HTML, \shortstack in LaTeX, doubled quotes in SQL), and reading converts them back.

Can it convert an HTML table from a web page?

Paste the page's table HTML (from the browser's developer tools or a saved page). Tags inside cells are removed, entities decoded and <br> kept as line breaks. Merged cells (colspan, rowspan) are not expanded.

Which SQL dialects are supported?

Standard SQL (also PostgreSQL and SQLite), MySQL and MariaDB, and SQL Server. They differ in how names are quoted and how backslashes and Unicode strings are written.

Is there a size limit?

Up to 5 million characters of input. The grid shows the first 200 rows and 30 columns for editing, but the conversion always includes every row.