Free online text tool

Add String After Number of Characters

Add String After Number of Characters inserts text after every set number of characters. Paste your text, choose the string and the count, click the button and copy the result. It is free and runs in your browser.

Add String After Number of Characters Tool

0Character Count
0Character Count (without spaces)
0Word Count
0Sentence Count
0Paragraph Count
0Line Count

Add String After Number of Characters Example

Every 4 characters, with a dash added.

Before
1234567890123456
After
1234-5678-9012-3456

Bookmark: press Ctrl+D (Windows) or Cmd+D (Mac) to save this tool.

Suggest a New ToolProvide Feedback on This Tool

What does Add String After Number of Characters do?

This tool inserts a string of text after every set number of characters. Choose the text to add and how many characters to count, and it is added again and again through your text.

Spaces, digits, letters and symbols all count as characters. The text is added only between groups, so nothing is left at the very end. You can also choose whether the count starts again on every new line.

Use it to group long numbers, split codes into pairs, break up a long string or format keys and IDs.

Add string after number of characters examples

Each example shows the setting used. Spaces count as characters.

SettingBeforeAfter
Every 4, "-"
1234567890123456
1234-5678-9012-3456
Every 3, ","
1234567
123,456,7
Every 2, " "
48656c6c6f
48 65 6c 6c 6f
Every 3, "-", reset on line break
abcde
fghij
abc-de
fgh-ij
Every 3, "-", no reset
abcde
fghij
abc-de
f-ghi-j

How to add a string after a number of characters

  1. 1
    Add your text
    Type or paste your text into the box, or import a text file.
  2. 2
    Set the string and the count
    Enter the text to add and the number of characters to count before it. Tick Reset counter on line break if each line should count from the start.
  3. 3
    Click Add String
    The text in the box is updated at once. Use Undo if you change your mind.
  4. 4
    Copy it
    Click Copy and paste the result where you need it.

When to add a string after a number of characters

Good for

Grouping long numbers, splitting hex or binary codes into pairs or bytes, breaking a long string into equal parts and formatting keys and IDs.

Check first

Spaces count as characters, but line breaks do not. Tick Reset counter on line break if every line should start counting from the first character.

Other tools

To add text at the start or end of every line, try Add Text To Each Line or Prefix Suffix.

Add string after number of characters FAQ

What does the Add String After Number of Characters tool do?

It inserts a piece of text, such as a dash, comma or space, after every set number of characters. For example, it can add a dash after every 4 characters of a long number.

How do I add a string after a number of characters?

Type or paste your text, enter the text to add and how many characters to count, then click Add String. The result replaces the text in the box. Click Copy to use it, or Undo to go back.

Does it count spaces and symbols?

Yes. Every character is counted, including spaces, digits, letters and symbols. Line breaks are not counted as characters.

Is the string added at the very end?

No. The string is only added between groups of characters. If your text ends exactly after a group, nothing is added at the end.

What does Reset counter on line break do?

When it is ticked, the count starts again at the beginning of every line. When it is not ticked, the count carries on from one line to the next.

What can I use as the string to add?

Anything you can type, such as a dash, comma, space, symbol or a few words. The box must not be empty.

What is it useful for?

Common uses are grouping long numbers like card or phone numbers, splitting hex codes into pairs, breaking a long string into equal parts and formatting codes and keys.

Is this tool free and is my text private?

Yes. It is free, needs no account and runs in your browser, so your text is not uploaded to a server.

Looking for more text tools?

Browse Modify Tools

Last updated: 27 October 2026