Align text into columns
Paste «name,age,city», «Alice,30,NY» and «Bob,25,Los Angeles» and get three clean columns 5, 3 and 11 characters wide, two spaces apart, readable in any monospaced view. No spreadsheet needed. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Text
- name,age,city Alice,30,NY Bob,25,Los Angeles
- Delimiter
- ,
- Align
- Left
- Gap
- 2
- Rows
- 3
- Columns
- 3
- Column widths
- 5, 3, 11
- Line count
- 3
Messy tabular paste jobs—CSV exports with ragged field lengths, logs glued with pipes, or hand-typed tab lists—are hard to scan until every column lines up. This tool takes multi-line text, splits each row on a chosen delimiter, measures the widest value in every column, and pads each cell so the table reads cleanly in any monospaced view. You control alignment (left, right, or center), the gap of spaces between columns, and whether fields are trimmed before measuring. There is no network inside the engine, no model, and no clock dependence: identical inputs always yield identical aligned output and column-width metadata for tests and pipelines.
How column alignment works on delimited text
Column alignment is a classic fixed-width layout problem: treat each line as a row of fields, discover how wide each column must be to hold its longest cell, then pad every shorter cell until the visual columns stack. This capability first splits the input on newlines (supporting LF, CRLF, and bare CR), then splits each non-empty line on the configured delimiter—comma by default, or tab, pipe, semicolon, or any short custom string you pass.
Optional field trimming removes leading and trailing whitespace before width is measured so accidental spaces in a CSV paste do not inflate a column. Ragged rows with fewer fields than the widest row are filled with empty strings so every row has the same column count.
For each column the engine stores the maximum cell length, then pads every cell to that width: left alignment appends spaces, right alignment prepends them, and center alignment splits the pad budget with floor on the left and the remainder on the right for a stable, deterministic center. Columns are rejoined with a configurable gap of pure spaces (default two), which produces the familiar column -t style of monospaced table without re-injecting the original delimiter into the display.
Empty source lines are preserved as blank lines in the output so section breaks in your paste survive.
Where aligned columns pay off in real work
Support and operations teams paste CSV fragments from tickets and need a glanceable monospaced table in chat or a runbook without opening a spreadsheet. Developers and SREs turn pipe- or tab-separated probe output into aligned columns for incident notes, pull-request descriptions, and terminal logs that stay readable when values differ in length. Data and analytics staff right-align numeric columns and left-align labels so mixed tables match the visual conventions of financial reports before they are copied into docs.
Educators and technical writers build teaching examples of fixed-width layout and delimiter concepts without installing column utilities on every student machine. Prefer this page when the search intent is align text into columns, pad delimited fields, or make a messy CSV readable as a table; if you need to convert prose into a Markdown table with an LLM, merge CSV files, or pad a single string to a fixed width, use those dedicated tools instead of stretching this contract.
What you can do with it
Pretty-print CSV and TSV pastes
Turn ragged comma- or tab-separated exports into a monospaced table you can paste into tickets, docs, and chat without opening a spreadsheet.
Align CLI and probe output
Pad pipe- or space-delimited command output so status columns line up in incident notes, PR descriptions, and runbooks.
Right-align numbers in mixed tables
Use right alignment on numeric columns and left on labels so financial or inventory snippets match report conventions in monospaced fonts.
FAQ
How do I align delimited text into columns?
Send multi-line text with a delimiter (default comma).
Which delimiters are supported?
Any non-empty string up to eight characters. Common choices are comma, tab, pipe (|), and semicolon. Default is comma. You may pass the two-character sequence \t for a tab.
Does alignment keep the original delimiter in the output?
No. Fields are padded and rejoined with a configurable gap of spaces (default two), like the classic column -t style, for clean monospaced reading.
What happens with ragged rows or blank lines?
Shorter rows are padded with empty cells up to the widest row. Completely empty source lines are preserved as blank lines in the aligned output.
What does it cost?
The browser tool is free and runs locally.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/str/align-columns \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"name,age,city\nAlice,30,NY\nBob,25,Los Angeles"}'const res = await fetch("https://api.kit.forhosting.com/str/align-columns", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "name,age,city\nAlice,30,NY\nBob,25,Los Angeles"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/str/align-columns",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "name,age,city\nAlice,30,NY\nBob,25,Los Angeles"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/str/align-columns", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"name,age,city\\nAlice,30,NY\\nBob,25,Los Angeles"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"name,age,city\nAlice,30,NY\nBob,25,Los Angeles"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/str/align-columns", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"text": "name,age,city\nAlice,30,NY\nBob,25,Los Angeles"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "str.align_columns",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
How column alignment works on delimited text
Oversized payloads, too many rows or columns, empty text, or an empty delimiter fail with invalid_input instead of silently truncating data.
Input contract, response shape, and validation rules
Optional gap is a non-negative integer number of spaces between padded columns, default two, capped so a single request cannot explode output size. Classic check: name,age,city then Alice,30,NY then Bob,25,Los Angeles with default comma and gap two yields three left-aligned columns whose city column is wide enough for Los Angeles and whose shorter cells are space-padded so a monospaced font shows clean vertical edges. Wire the free browser form for paste-and-copy formatting, then call the identical contract from scripts when you normalize CLI output, README tables, or support tickets before publishing. POST a JSON body with required text: a multi-line string of delimited fields. Optional delimiter defaults to a comma and accepts aliases such as sep or delim; write a real tab character or the two-character sequence backslash-t when clients cannot embed control characters easily. Optional align normalizes to left, right, or center (aliases l, r, c, start, end, middle). Optional trim_fields defaults to true; set it false when interior leading spaces are significant and must stay. On success the response echoes the normalized options and returns aligned (the full multi-line table), rows (count of non-empty source lines), columns (width of the matrix), column_widths (per-column character widths used for padding), line_count including blank lines, and operation set to align_columns. Missing text, empty text, empty delimiter, non-boolean trim flags, align values outside the allowed set, or sizes above the documented caps raise invalid_input and are not billed. Pricing for successful API calls is the published base of $0.002 per item.