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.
Every 4 characters, with a dash added.
1234567890123456
1234-5678-9012-3456
Bookmark: press Ctrl+D (Windows) or Cmd+D (Mac) to save this tool.
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.
Each example shows the setting used. Spaces count as characters.
| Setting | Before | After |
|---|---|---|
| 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 |
Grouping long numbers, splitting hex or binary codes into pairs or bytes, breaking a long string into equal parts and formatting keys and IDs.
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.
To add text at the start or end of every line, try Add Text To Each Line or Prefix Suffix.
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.
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.
Yes. Every character is counted, including spaces, digits, letters and symbols. Line breaks are not counted as characters.
No. The string is only added between groups of characters. If your text ends exactly after a group, nothing is added at the end.
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.
Anything you can type, such as a dash, comma, space, symbol or a few words. The box must not be empty.
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.
Yes. It is free, needs no account and runs in your browser, so your text is not uploaded to a server.
Last updated: 27 October 2026