CSV column aligner — line up CSV columns as a readable text table

Paste CSV, TSV or semicolon data and get a plain-text table with every column padded to the same width, separated by pipes or spaces, and numbers lined up on the right.

Live demo · real result from this tool
Column separator

Aligned

id | name        | city              | joined     | score 1 | Asha Rao    | Bengaluru         | 2024-03-01 |  92.5 2 | Smith, John | London            | 2023-11-15 |    88 3 | María López | Madrid            | 2025-01-20 | 4 | Li Wei      | Shanghai "Pudong" | 2022-07-09 |    79

Processed on your device — nothing is uploaded.

How to use the CSV column aligner

  1. Paste data into the CSV box. The sample has five columns, a quoted comma and an empty cell.
  2. Leave Delimiter on Detect, or choose Comma, Semicolon, Tab or Pipe.
  3. Choose the Column separator: a | b, a b (two spaces) or a, b (still CSV).
  4. Keep Right-align numbers ticked so figures line up by their last digit.
  5. Copy the Aligned text.

What it does and when to use it

Raw CSV is hard to scan. Padding every column to its widest value turns it into a table you can read in any monospace place: a terminal, a log message, a code comment, a commit message or a README code block. Right-aligned numbers make it easy to compare sizes down a column.

The pipe style has no separator row, so Markdown will not render it; for a table that renders on GitHub, use CSV to Markdown table. To work with the data rather than look at it, convert it with CSV to JSON or open it in the CSV viewer. Tab-separated exports can go through TSV to CSV first.

How it works

The papaparse library reads the data in your browser, handling quoted fields, delimiters inside quotes and doubled quotes, and skipping blank lines. Then the aligner:

  1. Pads short rows with empty cells so every row has the same number of columns.
  2. Replaces any line break inside a cell with a space.
  3. Measures each column’s widest value in visible characters, so accented letters and emoji count as one.
  4. Pads each cell to that width, on the left for numbers in data rows when right-alignment is on, otherwise on the right, and joins the cells with your separator.
  5. Trims trailing spaces at the end of each line.

Worked examples

These are the tool’s own outputs.

The sample. The quoted "Smith, John" is read as one value, the id and score columns align right, and María López’s missing score leaves the end of her row empty:

id | name        | city              | joined     | score
 1 | Asha Rao    | Bengaluru         | 2024-03-01 |  92.5
 2 | Smith, John | London            | 2023-11-15 |    88

Server stats with semicolons, space-separated. Detect finds the semicolons:

host        cpu   mem
web-1       0.45   512
db-primary   1.2  2048

The cpu and mem values end in the same column; the headers start at the left.

No right-alignment. a,b and longer,x with spaces and Right-align numbers unticked give a b over longer x.

Limits and tips

  • In the a, b mode, quoted cells keep their quotes, and the widths include them, so "Desk, oak" lines up with the other cells.
  • Wide characters such as Chinese or Japanese text take two columns in most fonts but are counted as one, so those rows can look uneven.
  • Very wide data wraps in narrow windows; extract fewer columns first with the CSV column extractor.

Frequently asked questions

Why is the header not right-aligned like the numbers?
Only data rows are checked for numbers. The first row is treated as a header and always padded on the right, so a short header such as cpu sits at the left of its column while the values below line up on the right.
Which values count as numbers?
Whole numbers and decimals with an optional minus sign, thousands commas and a trailing percent sign, such as 88, -3, 1,299, 0.45 and 12%. Dates like 2024-03-01, codes like A-1 and empty cells are treated as text.
Can I still open the a, b output as CSV?
It stays parseable, but the padding spaces become part of the values for most CSV readers. Quoted cells are measured with their quotes, so the commas line up. Use it for viewing; keep the original CSV for importing.
Does it work with data copied from a spreadsheet?
Yes. Spreadsheet cells copy as tab-separated text, and Detect recognises the tabs. Semicolon and pipe delimiters are detected too.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close