CSV to ANSI Table Converter
Convert CSV data to formatted ANSI/ASCII tables with Unicode box-drawing, Markdown, and plain ASCII styles. Copy or download instantly.
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.
Formulas
For each column j in a table of m columns and n rows (including the header row), the display width is:
Each cell is then padded to width wj using the alignment rule for column j:
The total rendered line width W including borders and padding (1 space each side) is:
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 Style | Top-Left | Horizontal | Top-Join | Top-Right | Vertical | Cross | Best 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 Rounded | ╭ | ─ | ┬ | ╮ | │ | ┼ | Friendly terminal output |
| Dots | . | . | . | . | : | : | Stylized logs |
| Header-Only Separator | - | ─ | - | - | │ | - | Clean minimal tables |
| Tab-Separated (TSV) | - | - | \t | - | \t | - | Spreadsheet import |
| Org-mode | - | - | + | - | | | + | Emacs Org-mode |