Align text into columns
Paste lines separated by a delimiter and every column is padded to the same width, so the data reads like a table in any monospaced font. Works for CSV, Markdown tables, configuration lines with = and whitespace-separated output.
Runs in your browser: nothing you enter is sent anywhere.
How to use it
- Paste the lines.
- Choose the delimiter and left or right alignment (right suits numbers).
- Copy the aligned text; view it in a monospaced font.
How it works
Each line is split at the delimiter and every cell is trimmed. The width of a column is its longest cell. Each cell is then padded with spaces to that width, the cells are joined again, and trailing spaces are removed. Empty lines are kept as they are.
Example
name,age
alice,30
bob,4
becomes
name, age
alice, 30
bob, 4
The longest first cell is “alice” (5 characters), so with its comma each first cell takes 6 characters, followed by one space.
Tips
- Aligned CSV is for reading. Spreadsheets will keep the spaces inside cells, so import the original file.
- In code, aligning a block of assignments on = makes differences easy to spot, but many formatters will undo it.
Frequently asked questions
How does the output look for each delimiter?
Commas, semicolons and colons stay attached to their cell and the padding comes after them (name, age). Equals signs and pipes get a space on each side (key = value, | a | b |). Tab- and space-separated text is joined with two spaces.
Does it handle quoted CSV fields?
Yes, for comma, semicolon and tab. A delimiter inside double quotes, as in "Smith, J", stays part of the cell, and the quotes are kept.
Can I align a Markdown table?
Choose the pipe. The outer pipes are kept and the dash row under the header is lengthened with dashes to the column width, so the table stays valid Markdown and looks tidy in the source.
Why are some columns still not lined up?
Alignment counts characters, which only lines up in a monospaced font. Characters that are wider on screen, such as Chinese, Japanese or Korean characters and many emoji, take two columns in most fonts and push the following text out of line.