CSV to Text Columns

Sometimes you need data laid out in readable columns without introducing Markdown, HTML or a spreadsheet, a code block in a README, a terminal-friendly report, a plain-text email to an ops team. This converter reads CSV (or tab, semicolon, pipe-separated) input and emits space-padded columns where every cell is padded to the width of the widest cell in that column. The result lines up perfectly in a monospace font.

How the columns get aligned

  1. 1

    Paste the data

    Any common flat-file separator works: comma, tab, semicolon or pipe.

  2. 2

    Pick the delimiter

    The tool parses quoted cells with `str_getcsv`, so embedded separators inside quotes are respected.

  3. 3

    Column widths measured

    For every column, the converter finds the widest cell across all rows and stores that as the target width.

  4. 4

    Cells padded with spaces

    Each cell is right-padded to the column width; columns are joined with two spaces between them.

Why monospace matters for this output

Space-padded alignment only works when every character is the same width. In proportional fonts (Helvetica, Arial, your blog body text) an i takes less horizontal space than an M, so the columns will look misaligned even though every cell has the same number of space characters.

Where it renders correctly

  • Markdown code blocks ( ``` )
  • <pre> and <code> HTML elements
  • Terminal output, log files
  • Rich-text fields set to monospace (most IDEs, Gitea issue bodies)

Where it will look broken

  • Regular paragraphs in blog posts
  • Gmail and most email clients (they use proportional fonts by default)
  • Slack messages outside of backticks
  • Notion plain-text blocks

Alternatives for human-readable prose

Target output Reach for
Web page CSV to HTML Table
GitHub README CSV to Markdown Converter
Spreadsheet CSV to Excel
API payload CSV to JSON

Tips

  • Short cells win. Very long values force a column to be extremely wide. Truncate long text first or let it wrap by post-processing the output line-by-line.
  • Tab-aligned is different. If you want \t-separated output for pasting into a spreadsheet, skip this tool and use a plain TSV export, alignment will break in the spreadsheet anyway.
  • Wide Unicode counts differently. The converter measures by mb_strlen which counts code points. Double-wide CJK characters will technically be wider than their count suggests; visually they can drift in some terminals.

Frequently Asked Questions

The tool pads cells with space characters. In proportional fonts an i occupies less horizontal space than an M, so even though the space count is correct, the pixels do not match. Render inside a code block or set the font to monospace.

Not directly, this tool uses double spaces as separators. For a pipe-delimited aligned view, post-process by replacing the double space with |, or use the CSV to Markdown Converter for a GFM-style table.

Missing cells are padded to the column width with spaces, so the output stays rectangular and aligns neatly.

Yes, the text you paste is sent to our server so the tool can align the columns. It is not stored and it is not added to the page link.

Related Tools

Tool available in other languages