Right-aligned padding via padStart
Width is the target column count. Lines shorter than Width are prefixed with the Char fill until they reach the target. Lines already at or beyond Width are returned unchanged. Char defaults to a single space; if you supply a multi-character string only the first character is used (this matches padStart's repeat behaviour).
Per Line is on by default and applies the pad to every line independently. Turn it off to pad the whole input as one continuous string, useful for right-aligning a single-line field. Width is bounded by the registry to 1 through 200.
Common uses: zero-padding numeric IDs (Width 6, Char 0) for sortable filenames, right-aligning numbers in a column, indenting log entries to a fixed timestamp slot. To remove the padding later run trim whitespace or a regex strip via regex replace.
How to use pad text on the left
- 1Paste your lines into the input panel on the left.
- 2Set Width to the number of characters each line should reach.
- 3Type the fill character into Char. Only the first character is used.
- 4Leave Per Line on (the default) to pad each line; turn it off to pad the whole input as one string.
- 5Click Copy or Download in the output header.
Keyboard shortcuts
Drive TextResult without touching the mouse.
| Shortcut | Action |
|---|---|
| Ctrl F | Open the find & replace panel inside the input Plus |
| Ctrl Z | Undo the last input change |
| Ctrl Shift Z | Redo |
| Ctrl Shift Enter | Toggle fullscreen focus on the editor Plus |
| Esc | Close find & replace, or exit fullscreen |
| Ctrl K | Open the command palette to jump to any tool Plus |
| Ctrl S | Save current workflow draft Plus |
| Ctrl P | Run a saved workflow Plus |
What this tool actually does
Backed by padStart
The pad call is line.padStart(width, char). JavaScript will repeat the fill char as needed to reach Width; if the line is already long enough, it is returned untouched.
Only the first character of Char is used
If you type ab the fill becomes a. This matches the registry shape (single-char fill) and avoids surprising overflow when the multi-char string does not divide evenly.
Empty Char falls back to space
If Char is left empty the tool substitutes a regular space. There is no way to disable padding while keeping the width number; set Width to 1 for a near-no-op.
Per Line is on by default
Each line is padded independently. Turn the toggle off to pad the whole input as one string; line breaks then count toward the width and are usually undesired.
Width is bounded 1 to 200
The registry caps Width at 200 to keep the output reasonable. Beyond that, manual extension or a piped run is the better path.
Worked example
Width 8, Char 0, Per Line on. Each numeric line is zero-padded to eight characters, ready for filename or sort-key use.
1 23 456 7890
00000001 00000023 00000456 00007890
Settings reference
| Behaviour | Effect on output |
|---|---|
| Width (1-200) | Target column count. Lines below the width grow; lines at or above pass through. |
| Char populated | First character is used as the fill. Multi-char input is truncated to the first char. |
| Char empty | Falls back to a single space. |
| Per Line on (default) | Each line is padded independently; line breaks are preserved. |
| Per Line off | The whole input is padded as one string; line breaks count toward the width. |
| Line already at or above width | Returned unchanged. |
| Line endings | CRLF input becomes LF output (split/join in per-line mode). |
FAQ
How do I zero-pad numeric IDs?
0 and Width to your target length. 1 becomes 0001 at width 4, 23 becomes 00000023 at width 8.Why does Char only use one character?
padStart(width, char) and the registry treats the field as a single fill char. The implementation takes char.charAt(0) to keep behaviour predictable.What if my line is already wider than Width?
padStart never truncates; if you want shortening use truncate text.How do I pad the right side instead?
Does anything upload?
padStart runs in your browser. Your text never leaves the page.