Guide
Turning text tables into data, and data into text tables
Text tables turn up everywhere: query results pasted from a MySQL or PostgreSQL terminal into a ticket, output from Python’s tabulate or PrettyTable in a log, box-drawn tables in documentation, Markdown tables in a README. They are easy to read but awkward to reuse. This converter turns them back into data you can open in a spreadsheet or paste into documentation, and draws new text tables from CSV or spreadsheet cells.
Tables it recognises
MySQL and SQLite output and Python libraries use +—+—+ borders with | between cells. PostgreSQL’s psql prints a header, a ––+–– rule and a “(3 rows)” footer. Modern terminals and documentation use box-drawing characters such as ┌─┬─┐ and │. Markdown tables use pipes with a — row under the header. The kind detected is shown under the result.
How columns are found
Splitting on every | breaks as soon as a cell contains one, which happens with log lines, shell commands and URLs. When a table has a border, the converter instead takes the column edges from the positions of the + or ┼ junctions in it, and cuts every row at those positions. A cell that reads a | b stays one cell. Markdown tables have no border, so pipes split cells there, with \| read as a literal pipe.
Headers, wrapped rows and footers
A rule directly after the first row, or a === rule as in reStructuredText grid tables, marks that row as the header. Some tools wrap long values onto a second line inside the same cell; with “Join wrapped lines” on, a line whose first cell is empty is merged into the row above. Footers such as “3 rows in set (0.00 sec)” and any text outside the table are ignored.
Output formats
Markdown gives a table for a README or issue, with number columns right-aligned. CSV and TSV open in Excel, Google Sheets or a database import; TSV pastes straight into spreadsheet cells. JSON produces an array of objects using the header as keys. HTML gives a plain table to style. The ASCII, box and rounded options redraw the table neatly, which is useful for code comments, plain-text emails and chat.
Drawing a table from data
Paste CSV, TSV or cells copied from a spreadsheet instead of a drawn table, choose a text style, and the data is drawn with aligned columns. a,b and 1,2 come back as a box table starting with ┌───┬───┐.
Wide characters
Text tables align by character count, but Chinese, Japanese, Korean and many emoji take two columns in most terminals. Output from such tools may be misaligned before you paste it, so check rows with those characters.
A worked example
The sample MySQL result has id, name, city and orders columns and a “3 rows in set” footer. As Markdown it starts | id | name, keeps “São Paulo” intact and drops the footer; as JSON, the third object’s orders value is “104”.
Cleaning up after converting
Terminal output often pads values with spaces and prints NULL for missing data. Leading and trailing spaces are trimmed from every cell, but NULL stays as the word NULL; replace it in the spreadsheet if you want empty cells. Check columns of numbers before calculating with them, since thousands separators and units may have come along as text.
Related tools
Make Markdown tables from spreadsheet files with CSV to Markdown Table, LaTeX tables with CSV to LaTeX, wiki tables with CSV to MediaWiki, or JSON from CSV with CSV to JSON.
Checked against the current version of the ASCII Table Converter on .

