If you want to insert a delimiter after every N characters in Google Sheets, one of the most efficient ways is to use the REGEXREPLACE function. This can be helpful in various use cases — such as formatting text strings, preparing data for splitting, or inserting separators into codes or IDs.
Let’s walk through how to use this function effectively.
Why Insert a Delimiter After N Characters in Google Sheets?
Inserting a delimiter into a text string every N characters can help:
- Split a text after every N characters.
- Add a space, comma, pipe, or any custom separator at regular intervals.
- Format data like product codes, IDs, or even strings of characters.
Google Sheets doesn’t have a built-in tool for this specific task, but we can easily do it using a clever REGEXREPLACE formula.
Generic Formulas to Insert a Delimiter After N Characters
Here are two formula patterns you can use:
1. To Insert a Delimiter After Every N Characters
=REGEXREPLACE(A1, ".{n}", "$0,")
Replace n with the number of characters after which you want to insert the delimiter, and replace the comma (",") with your desired delimiter.
2. To Insert a Delimiter After the First N Characters Only
=REGEXREPLACE(A1, "^.{n}", "$0,")
This inserts the delimiter just once — after the first n characters.
We’ll now look at examples to make this clear.
Examples: Insert a Delimiter After Every N Characters in Google Sheets
Let’s say cell A1 contains the following string:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
To insert a comma after every character, use:
=REGEXREPLACE(A1, ".{1}", "$0,")
Output:
A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,
If you want to insert the delimiter after every 2 characters, use:
=REGEXREPLACE(A1, ".{2}", "$0,")
Output:
AB,CD,EF,GH,IJ,KL,MN,OP,QR,ST,UV,WX,YZ,
To change the delimiter, simply replace the comma with another symbol. For example, to use a pipe (|):
=REGEXREPLACE(A1, ".{2}", "$0|")
Output:
AB|CD|EF|GH|IJ|KL|MN|OP|QR|ST|UV|WX|YZ|
How to Split a Text String After Every N Characters in Google Sheets
If your goal is to split the text every N characters, you can combine REGEXREPLACE with SPLIT:
=SPLIT(REGEXREPLACE(A1, ".{1}", "$0|"), "|")
This approach inserts a delimiter every N characters and then splits the string using that delimiter.

Insert a Delimiter After the First N Characters Only
To insert a delimiter after just the first N characters, slightly modify the formula by adding the caret ^ at the beginning of the regex:
=REGEXREPLACE(A1, "^.{13}", "$0-")
This would insert a hyphen after the first 13 characters.
ABCDEFGHIJKLM-NOPQRSTUVWXYZ
If A1 contains "InfoInspired" and you want to insert a space after the 4th character:
=REGEXREPLACE(A1, "^.{4}", "$0 ")
Output:
Info Inspired
This is a great trick when you need to add a space or any other separator at a specific point in a string.
Can You Insert a Delimiter After N Characters in Numbers?
Yes, but there’s a catch.
If the cell contains a number (e.g., 1256789), using REGEXREPLACE directly will result in a #VALUE! error because the function expects a text value.
Workarounds for Numbers in Google Sheets
- Convert the number to text first:
=REGEXREPLACE(TO_TEXT(A1), "^.{3}", "$0-")
- Format the cell as plain text:
Go to Format > Number > Plain Text in the menu.
Then use the regularREGEXREPLACEformula:
=REGEXREPLACE(A1, "^.{3}", "$0-")
Array Formulas: Insert a Delimiter into Multiple Rows
Want to apply this to a column of text or numbers? Use ARRAYFORMULA.
For numbers:
=ARRAYFORMULA(IF(A1:A="", "", REGEXREPLACE(TO_TEXT(A1:A), "^.{3}", "$0-")))

For text strings:
=ARRAYFORMULA(IF(A1:A="", "", REGEXREPLACE(A1:A, "^.{3}", "$0-")))
These formulas help you insert a delimiter after N characters in Google Sheets across an entire range.
Recap: Use Cases for Inserting Delimiters
- Format product or employee codes.
- Break long strings into readable chunks.
- Prepare data for splitting by inserting a temporary delimiter.
- Split text after or every N characters using SPLIT.
Related Resources
- Split Text into Groups of N Words in Google Sheets (Using Regex + SPLIT)
- Split and Count Words in Google Sheets (Array Formula)
- Split Text in Google Sheets Without Losing Formatting (Preserve Zeros & Hex)
- How to Split a Number into Digits in Google Sheets
- How to Remove Extra Delimiters in Google Sheets
- Split Numbers from Text Without Delimiters in Google Sheets
- How to Replace Every Nth Delimiter in Google Sheets






















I am using transpose and split by every new line (char(10)) to split to rows a very long text from a single cell. Is there a way to insert a new line break if the line exceeds a certain number of characters (and not breaking a word in two)?
I am concatenating cells with long text, then splitting to rows (for printing purpose) and I need to have no overflowing cells, and keep the line breaks I already have.
Hi,
To answer this, I may require a sample image/sheet that explains the problem.