Overview
Introduction
Plain-text tables and reports often need a numeric or short-text column right-aligned for readability.
This tool applies that alignment to every line of your input at once.
What Is Right Aligner?
A line-by-line right-aligner that space-pads each line on the left to a fixed column width, so shorter lines line up flush-right against longer ones.
It runs entirely client-side as part of this site's String Tools collection, so nothing you paste is ever uploaded to a server.
How Right Aligner Works
Input is split into lines, and each line is individually padded on the left with spaces to the target width using padStart().
The transformation happens synchronously in JavaScript the moment you type, with no network round trip involved.
When To Use Right Aligner
Use it when formatting a plain-text table's numeric column, or aligning a list of short codes for a monospace display.
It's a fast way to get the answer without opening a code editor, a REPL, or writing a one-off script just to check.
Often used alongside Left Padder and Center Aligner.
Features
Advantages
- Processes every line at once instead of padding each individually.
- Uses spaces specifically, matching typical visual-alignment expectations.
Limitations
- Only pads with spaces; use Left-pad a String if you need a different pad character.
- Assumes a monospace font for the alignment to actually look aligned.
Examples
Best Practices & Notes
Best Practices
- View the result in a monospace font; proportional fonts won't show true visual alignment.
Developer Notes
Each line is padded independently via padStart(width, " "), rather than padding the whole multi-line string as one unit, which would incorrectly measure length across newlines.
Right Aligner Use Cases
- Right-aligning a numeric column in a plain-text report
- Aligning short codes for a monospace terminal display
- Formatting output for a fixed-width log format
Common Mistakes
- Viewing the output in a proportional font, where alignment won't visually line up.
Tips
- Use Left-pad a String instead if you need a non-space pad character.