How to use the CSV column aligner
- Paste data into the CSV box. The sample has five columns, a quoted comma and an empty cell.
- Leave Delimiter on Detect, or choose Comma, Semicolon, Tab or Pipe.
- Choose the Column separator:
a | b,a b(two spaces) ora, b (still CSV). - Keep Right-align numbers ticked so figures line up by their last digit.
- 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:
- Pads short rows with empty cells so every row has the same number of columns.
- Replaces any line break inside a cell with a space.
- Measures each column’s widest value in visible characters, so accented letters and emoji count as one.
- 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.
- 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?
Which values count as numbers?
Can I still open the a, b output as CSV?
Does it work with data copied from a spreadsheet?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.