How does it work?
This tool right-aligns text by adding spaces at the beginning of each line. The alignment is based on the specified width or the length of the longest line, whichever is greater.
The process works as follows:
- The tool determines the maximum width (either from your input or the longest line)
- For each line, it first removes any existing leading whitespace
- It then calculates how many spaces to add at the beginning to push the text to the right edge
- The spaces are added, and the result is a visually right-aligned text
Example
Original text
Title
Subtitle
This is a longer line of text that will be right-aligned
Short line
Another longer line that demonstrates right alignment
The EndAfter right alignment
Title
Subtitle
This is a longer line of text that will be right-aligned
Short line
Another longer line that demonstrates right alignment
The EndParameters
- Text to right-align: The input text that you want to align to the right
- Width (characters): The desired width in characters for the alignment (default: 80). The actual width used will be the maximum of this value and the length of the longest line.
This tool is useful for:
- Creating right-aligned text in fixed-width contexts
- Formatting numbers or currency values in reports
- Aligning dates or timestamps to the right
- Creating specific text layouts for documentation
- Formatting code comments or ASCII art
Note: For best results, view the output in a monospaced font (which is used by default in the output area).
Related Tools
- Align Left - Align text to the left margin
- Align Center - Center text between margins
- Align Carets - Align text at specific positions
- Format to Columns - Arrange text into columns
- Create Border - Add borders around text
All Tools
See all available tools