Align Pipe-Delimited Data

Align text separated by pipe characters (|) into evenly spaced columns. Common in Markdown tables, CLI output, and database reports.

Delimiter Types

Detailed Explanation

Working with Pipe-Delimited Data

The pipe character (|) is a popular column separator in Markdown tables, database CLI output (psql, mysql), and many logging frameworks. When rows have varying content lengths, the pipes no longer line up and the table becomes difficult to read.

Before

|Name|Department|Salary|Start Date|
|---|---|---|---|
|Alice|Engineering|95000|2021-03-15|
|Bob|Marketing|72000|2022-01-10|
|Charlie|Engineering|105000|2019-07-22|
|Diana|Sales|68000|2023-06-01|

After

| Name    | Department  | Salary | Start Date |
| ---     | ---         | ---    | ---        |
| Alice   | Engineering | 95000  | 2021-03-15 |
| Bob     | Marketing   | 72000  | 2022-01-10 |
| Charlie | Engineering | 105000 | 2019-07-22 |
| Diana   | Sales       | 68000  | 2023-06-01 |

Steps

  1. Set the Input Delimiter to Pipe |.
  2. Set the Output Delimiter to Pipe | as well (or keep Same as Input).
  3. Enable Trim whitespace to strip spaces around cell contents.
  4. Right-align the Salary column for easier numeric comparison.

Edge Cases

  • Leading and trailing pipes on each line produce empty first and last cells. The tool handles these gracefully by padding them like any other cell.
  • If your data contains literal pipe characters within a cell value, use a different delimiter or escape them before alignment.

Use Case

A developer is editing a Markdown README and wants to reformat a messy pipe-delimited table so that all columns line up in the source file.

Try It — Text Column Aligner

Open full tool