TextArray
100% local

Pad text

Pad each line to a set length with a chosen character, from the left, right or both sides.

Input
Output

Pad text

Paste a list of lines and pad every one of them to the same length. Pick the target length, the side the padding goes on and the character to pad with — a space by default, a zero for numbers, or any character you type in. It is the quick way to turn 7, 42 and 1337 into 0007, 0042 and 1337, give filenames sortable numeric prefixes, line up columns in fixed-width data files, or build simple ASCII layouts.

Left padding is the classic choice for numbers: values grow to the same width and sort correctly as text. Right padding fills lines out to a fixed width, which keeps hand-made columns straight in monospace output. Both-side padding centers each line within the target width; when the leftover space is odd, the extra character goes to the right.

Lines already at the target length pass through untouched, and longer lines stay as they are unless you switch on "Truncate longer lines", which cuts them down to exactly the target length — useful when a fixed-width format really does demand identical widths. Length is counted in visible characters, so accented letters and emoji count as one each, and empty lines are padded to the full width like any other line.

Everything runs locally in your browser and nothing you paste is uploaded anywhere. The tally under the output shows how many lines were padded and how many were truncated, so you can verify the result at a glance before copying it or downloading it as a .txt file.

FAQ

How do I zero-pad numbers?
Set the pad character to 0, keep the side on left and choose the target length. 7 becomes 0007 at length 4.
What happens to lines longer than the target length?
They pass through unchanged by default. Turn on "Truncate longer lines" to cut them down to exactly the target length, keeping the start of the line.
Can I pad with more than one character?
The padding uses a single character, so only the first character you type counts. Spaces, zeros, dots or any Unicode character work.
How is centering handled when the space does not split evenly?
The line is centered within the target length and the odd leftover character goes to the right side.
Is my text uploaded anywhere?
No. The tool runs entirely in your browser and your text never leaves your device.