About
Add spaces or characters to the beginning or end of text. This tool can be used to achieve alignment or formatting of text.
Add spaces or a chosen character to the start or end of each line. Prepare fixed width labels and aligned plain text examples.
How to use
Set the target length, side, and padding character. Use a single character and apply to the lines. Lines already long enough are not shortened.
Example
Padding 42 to length 5 with zeros on the left gives 00042.
FAQ
Does it format a numeric value?
No. It adds text characters and keeps longer lines. Check the receiving system before using padded identifiers or numbers.
A practical task
Choose the padding direction according to the field. Leading zeros can make fixed length sample codes, while trailing spaces can align a plain text display. Neither operation changes the underlying meaning of an identifier or validates its format.
Another useful question
What if I enter several padding characters?
A repeated multi character string can exceed the requested width. Use one character for predictable lengths and inspect the result before importing fixed width data.
Details for interpreting the result
| Detail | Explanation |
|---|---|
| Monospace alignment | In a monospace font, ordinary characters occupy a regular grid. Proportional fonts use different widths, so inserted spaces do not create reliable visual columns. Check display settings before judging padded text. |
| Whitespace characters | An ordinary space, a tab, a nonbreaking space, and a zero width space are different characters. They can look similar or invisible. Choose the exact kind of cleanup instead of treating all blank looking input as equivalent. |
| Tabs and positions | A tab character usually moves to a tab stop in an editor. Replacing it with a fixed number of spaces is a different operation. The visible distance depends on the editor's tab width and the current position. |
| Trimming and content | Trimming removes characters from an edge rather than the middle. Whole text trimming differs from trimming every line. Preserve indentation in code or structured text when it carries meaning. |
| Paragraphs and lines | A manual line break and a paragraph boundary serve different purposes. Export tools can map them differently. Inspect lists, addresses, and intentional blank lines rather than treating every visible break as interchangeable. |
| Line endings | A line break can use LF or CRLF. They look similar in an editor but contain different characters. Byte comparisons and checksums depend on the exact representation, including a final line break. |
| Visible symbols | What looks like one symbol can contain several Unicode components. Emoji sequences can include a base symbol, a skin tone, and joining characters. Counting or splitting them by bytes changes their structure. |