Text Padding

Pads each line with spaces, zeros or another character until it reaches a length you set. It is useful for lining up columns in plain text, adding leading zeros to numbers or codes, and preparing fixed-width lists.

Up to 1 MiB.

Options

One character, for example a space, 0, . or -

How to use the Text Padding

  1. Paste your text; each line is padded separately.
  2. Set the Target length, the side to pad and the Fill character (a space, 0, a dot or any single character).

Rules applied

  • Lines already at or above the target length are left unchanged.
  • Length is measured in visible characters.

Limitations

  • Characters that display wider (Chinese, emoji) count as one, so columns may not line up exactly in every font.

Worked examples

Zero-pad numbers

Input

7
42
1234

Result

00007
00042
01234
Centre with dashes

Input

Title

Result

-----Title-----

Practical uses

  • Zero-padding file numbers

    A photographer needs numbers such as 7 and 42 to have the same width so that files sort in the right order. They paste the numbers, set the target length and choose 0 as the fill character on the left. Each number gains leading zeros and the file list sorts correctly.

  • Centring a heading in plain text

    A developer formats a README or log banner by centring a title in a fixed width. They set the target length, pick the centred option and choose a dash as the fill character. The title ends up in the middle with dashes on either side, and no manual counting is needed.

Privacy: this tool runs entirely in your browser. Your text is not uploaded, logged or saved, and it is never sent to analytics. Maximum input: 1 MiB.