About the Text Aligner
Documents have alignment buttons, but plain text does not. When you write a README, a code comment, a terminal banner or an ASCII layout, you have to add spaces by hand to centre or right-align a line. This text aligner does it for you. Set a width in characters, choose left, centre, right or justified, and each line is padded with spaces to fit. Justify spreads the words in a line so that it fills the full width, leaving the last line of each paragraph alone. The result looks right in any monospace font, such as those used in code editors and terminals.
Updated October 2026
How to use the Text Aligner
- 1Paste your text with one line for each row.
- 2Choose left, centre, right or justify.
- 3Set the width in characters.
- 4View the result in a monospace font, as in a code editor.
- 5Copy it into your file.
Example
With a width of 40, the line A short title is centred with 14 spaces in front of it, and the line Second line of text with 11. Right-aligned, the same lines end at column 40. Justified, the longer lines spread their words so that each reaches the width, which looks tidy for a block of text in a README.
Justified plain text has one catch: lines with few words get very large gaps between them, which can look strange. A paragraph that is already wrapped to roughly the same width as the target looks best. If a line has only one word, it is left on the left because there is nothing to spread. Use centre alignment for titles and short captions, right alignment for dates and signatures, and left alignment for everything else.
Where alignment helps
- README files and plain-text documentation.
- Code comment headers and licence blocks.
- Terminal output, banners and menus.
- Text receipts and fixed-width reports.
- Email signatures in monospace clients.
Tips
Pick a width that matches where the text will be shown, such as 80 for terminals or 72 for email. Wrap long paragraphs first, then justify, because justify only stretches lines that are already shorter than the width. If you plan to add a border, subtract the border characters from the width. Always check the result in the same font where it will be used.
Related tools
The Word Wrap Tool breaks long lines, the Remove Extra Spaces tool cleans up spacing, the Add Prefix and Suffix to Lines tool adds borders, and the Text Formatter handles case and spacing. For web layouts, use CSS rather than spaces.
Features
- Left, centre, right and justify
- Any width from 5 to 300
- Trims stray spaces before aligning
- Leaves lines longer than the width alone
- Last line of a paragraph not stretched
- Copy and download
Frequently asked questions
How do I centre text in plain text?
Add spaces in front of each line until it sits in the middle of the width. This tool computes the spaces for you: with a width of 40 and a 10-character line, 15 spaces are added in front of it.
Why does the result only line up in a monospace font?
Spaces and letters have different widths in most fonts, so alignment by spaces only works when every character has the same width. Code editors, terminals and the result box use a monospace-like layout.
What does justify do?
It adds spaces between words so that each line reaches the full width, giving straight edges on both sides. The last line before a blank line is left as it is, as in a printed paragraph.
What if a line is longer than the width?
It is left unchanged, since cutting words would damage the text. Use the Word Wrap Tool first if you want long lines broken.
Will it add spaces at the end of lines?
Centred text only gets spaces on the left, and right-aligned text gets spaces on the left too, so no trailing spaces are added. Justify adds spaces only between words.
Can I use it for ASCII art or banners?
Yes, for text lines. For boxes or borders, add the characters after aligning. The Add Prefix and Suffix to Lines tool can put a border character at both ends of every line.