Trim / Pad

Strip unwanted characters from the edges of text, or pad it out to a fixed width.

Operation
Input
Output

About this tool

Trim removes characters from the beginning and/or end of the text. Leave Characters empty to strip any whitespace (spaces, tabs, line breaks, non-breaking spaces), or list the exact characters to strip — for example *-# removes any mix of asterisks, dashes and hashes from the edges.

Pad extends text to the chosen width. Pad left right-aligns it, Pad right left-aligns it and Center splits the padding (any odd character goes on the right). A multi-character fill such as .- is repeated as needed. Text that is already as wide as the target is left alone. Widths are counted in Unicode code points.

Privacy

All processing happens in your browser. Nothing you type is sent, stored or logged.