User Rating 0.0
Total Usage 0 times
ANSI Table Output

    
Is this tool helpful?

Your feedback helps us improve.

About

Raw CSV is unreadable in terminals, documentation, and code comments. Misaligned columns cause data misinterpretation. A missing delimiter or an unescaped quote can shift every subsequent field, producing silent errors that propagate into reports and pipelines. This converter implements an RFC 4180-compliant parser that correctly handles quoted fields containing commas, newlines, and escaped double-quote pairs (""). It then computes the maximum display width wj for each column j and renders a fixed-width table using your chosen border style: Unicode box-drawing characters (U+2500 block), plain ASCII, Markdown pipe syntax, or reStructuredText grid format.

Column alignment is auto-detected: fields that parse as finite numbers are right-aligned; all others left-align. You can override this per column. The tool handles edge cases including empty fields, trailing delimiters, and rows with inconsistent column counts (short rows are padded, long rows are truncated to header width). Output is pure plaintext suitable for pasting into terminals, README files, Slack code blocks, or monospaced email.

csv to table ansi table ascii table csv formatter csv to markdown table box drawing table text table generator

Formulas

For each column j in a table of m columns and n rows (including the header row), the display width is:

wj = max({ len(celli,j) | i [0, n) })

Each cell is then padded to width wj using the alignment rule for column j:

padleft =
{
wj len(cell) if right-alignedfloor(wj len(cell)2) if center-aligned0 if left-aligned

The total rendered line width W including borders and padding (1 space each side) is:

W = 1 + mj=1 (wj + 3)

Where the 3 accounts for left pad (1), right pad (1), and the right border character (1). RFC 4180 parsing uses a finite state machine with states: FIELD_START, UNQUOTED, QUOTED, QUOTE_IN_QUOTED. Transitions occur on characters: comma (delimiter), double-quote ("), newline (\n), and any other character.

Reference Data

Border StyleTop-LeftHorizontalTop-JoinTop-RightVerticalCrossBest For
Unicode Box (Light)Terminals, modern consoles
Unicode Box (Heavy)Emphasis, presentations
Unicode Box (Double)Legacy DOS, CP437 displays
ASCII Classic+-++|+Universal compatibility
Markdown - -| - | - GitHub, GitLab, docs
reStructuredText+=++|+Sphinx documentation
Compact - - - - - - Minimal, no borders
Unicode RoundedFriendly terminal output
Dots....::Stylized logs
Header-Only Separator - - - - Clean minimal tables
Tab-Separated (TSV) - - \t - \t - Spreadsheet import
Org-mode - -+ - |+Emacs Org-mode

Frequently Asked Questions

The parser implements RFC 4180 using a state machine. When a field begins with a double-quote character, it enters the QUOTED state. In this state, commas and newline characters are treated as literal content rather than delimiters. The field ends only when an unescaped closing double-quote is encountered (a double-quote followed by a comma, newline, or end-of-input). Two consecutive double-quotes inside a quoted field are interpreted as a single literal double-quote character.
The converter normalizes all rows to the column count of the first row (or the header row if the first-row-as-header option is enabled). Rows with fewer fields are padded with empty strings on the right. Rows with more fields than the reference count have their excess fields silently dropped. This prevents misaligned table output. A warning toast is displayed when row length inconsistency is detected.
Use the Markdown style. GitHub's renderer interprets pipe-delimited tables natively, so the output can be pasted directly into .md files. The converter produces a header row separated by a line of dashes (with colons for alignment indicators: leading colon for left, trailing for right, both for center). Note that GitHub Flavored Markdown does not support cell spanning or multiline cells.
Auto-alignment inspects every non-empty data cell in a column (excluding the header). If all non-empty values parse as finite numbers (integers, decimals, or negative values), the column is right-aligned. If any single non-empty value is non-numeric, the entire column defaults to left-alignment. Empty cells are ignored during this detection. You can override the detected alignment for any column using the alignment selector.
Yes. The tool supports comma, semicolon, tab, and pipe as input delimiters. European CSV exports from Excel often use semicolons because the comma serves as the decimal separator in many locales. Select the appropriate delimiter before pasting or uploading your data. The auto-detect option examines the first 5 lines and selects the delimiter that produces the most consistent column count.
The converter runs entirely in the browser using synchronous JavaScript string operations. Practical limits depend on the device. On a modern desktop browser, CSV files up to approximately 5-10 MB (roughly 50,000-100,000 rows with 10 columns) render within a few seconds. Beyond that, the browser tab may become unresponsive. For very large files, consider splitting the CSV or using a command-line tool like the column utility on Unix systems.