Skip to content
Tezmy Tools

Text Padding Tool

Pad every line to the same length with zeros, spaces or any character

One character, such as 0, space or a dot.

Lines already at least this long are left alone.

Runs in your browser. Nothing is uploaded.

About the Text Padding Tool

Many systems need values of a fixed width: invoice numbers like 000042, codes padded to ten characters, or text aligned at the right edge. This tool pads every line to the length you choose. Type the width, pick the padding character (a zero, a space, a dot or anything else) and say whether the padding goes on the left, the right or both sides. Lines that are already long enough are left alone and lines are padded one at a time. It works in your browser and your text is not uploaded.

Updated October 2026

How to use the Text Padding Tool

  1. 1Paste your text, one value per line.
  2. 2Enter the length each line should have.
  3. 3Type the character to pad with, such as 0 or a space.
  4. 4Choose left, right or both sides.
  5. 5Copy the padded lines.

Where padding is needed

Databases and legacy systems often store codes as fixed-width fields. Filenames sort in the right order only when numbers have the same width, so photo7.jpg sorts after photo10.jpg until it becomes photo007.jpg. Reports and logs look neater when columns have equal width. Padding is the simple fix for all of these.

Doing it for hundreds of values by hand is slow. Paste them and the whole list is padded at once.

    Left, right or both

    Padding on the left pushes the text to the right, which suits numbers and identifiers. Padding on the right keeps the text on the left and fills the remainder, which suits names and labels. Padding on both sides centres the text in the width you picked.

    • Left: 007
    • Right: 7..
    • Both: .7.

    Good to know

    The length counts characters, not bytes, so accented letters and emoji count as one each. Keep the original list, because padding cannot always be undone if the text itself started with the padding character.

      Examples

      Padding 7, 42, 1234 and abc to a width of 6 with zeros on the left gives 000007, 000042, 001234 and 000abc. Padding the same lines with spaces on the right gives lines that all end at the same column, ready to pass to another program.

      Lines already at least as long as the width you chose are returned unchanged, so you can run the tool again with a bigger width without harm.

        Phone and computer

        Paste your lines, type the width and the character, and copy the result. The same steps work on both; a phone keyboard may need a tap to switch to the symbol keys for characters like a dot or a dash.

          Privacy

          Padding is done in your browser, and your values are not uploaded or stored. That is useful when the lines are account numbers, order codes or other identifiers that you would rather keep to yourself. Padded lines are handy for tables, and Text Columns Formatter lines up whole blocks of text into columns. Add Line Numbers to Text numbers the rows first, and Sort Lines by Length helps you see which line needs the most padding.

            Features

            • Pad on the left, right or both sides
            • Any padding character
            • Works line by line
            • Longer lines are left alone
            • Quick leading zeros for numbers
            • Private: nothing is uploaded

            Frequently asked questions

            How do I add leading zeros?

            Set the length, for example 6, use 0 as the padding character and choose the left side. The number 42 becomes 000042 and 7 becomes 000007.

            What does padding on both sides do?

            It centres the text. When the padding is an odd number of characters, the extra character goes on the right.

            What if a line is longer than the length I chose?

            It is not changed or cut. Only shorter lines receive padding.

            Can I pad with a space?

            Yes. Type a space as the padding character. Right-padding with spaces is useful for lining up text in a fixed-width font.

            Can I use more than one character as padding?

            The tool expects one character, because the width of the result has to be exact. Use a single symbol such as a dot or a dash.

            Is my text uploaded?

            No. The padding is done in your browser and your text is not sent anywhere.

            Related tools