KutoolsforOffice β€” One Suite. Five Tools. Get More Done.

How to Add Spaces Between Characters, Letters, or Digits in Excel

AuthorSiluviaLast modified

When working with imported codes, product IDs, serial numbers, or text strings in Excel, you may need to insert spaces to make the data easier to read. For example, you may want to change ABCDE to A B C D E, 123456 to 1 2 3 4 5 6, or SKU99 to S K U 9 9.

Excel does not provide a single built-in button for all these cases, but you can do it with formulas, VBA, or Kutools for Excel. This tutorial shows several practical ways to add spaces between letters, digits, or every character in Excel.

Add spaces between characters with a formula

Method 1: Add spaces between characters with a formula

Method 2: Add spaces between letters, numbers, or characters with Kutools

Method 3: Add spaces between characters with VBA

Which method should you use?

Frequently asked questions


Method 1: Add spaces between characters with a formula

If you are using Microsoft 365 or Excel 2021 and later versions, you can use a formula to split the text into individual characters and join them back together with spaces.

Suppose the original text is in cell A2.

  1. In cell B2, enter the following formula, and press Enter.
  2. =TEXTJOIN(" ",TRUE,MID(A2,SEQUENCE(LEN(A2)),1))
  3. Drag the fill handle down to apply the formula to other cells.

Result: The formula adds a space between each character in the selected text string.
Add spaces between characters with a formula

How this formula works:

  • LEN(A2) counts how many characters are in the cell.
  • SEQUENCE(LEN(A2)) creates a list of character positions.
  • MID(A2,SEQUENCE(LEN(A2)),1) extracts each character one by one.
  • TEXTJOIN(" ",TRUE,...) joins the extracted characters with spaces.

πŸ’‘ Tip: This formula works best in Microsoft 365 and Excel 2021 or later. If you are using an older Excel version, consider using VBA or Kutools for Excel instead.

Limitations of formulas

  • It requires Microsoft 365 or Excel 2021 and later for the formula used in this method.
  • The result is formula-based, so you may need to copy and paste the results as values.
  • It separates every character in the cell, including letters, numbers, and symbols.
  • It does not provide flexible position options, such as adding spaces only before letters or before numeric characters.

Method 2: Add spaces between letters, numbers, or characters with Kutools

If you want to add spaces to many cells without writing formulas or VBA, you can use the Add Text feature of Kutools for Excel. Compared with a formula, this method gives you more flexible position options, so you can choose whether to add spaces before letters, between every character, or before numeric characters.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Integrated with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

Case 1: Add spaces between letters

This case is useful when your cells contain letters, and you want to add a space before each letter, so text such as Excel becomes E x c e l.

Recommended option: Before uppercase/lowercase letters

  1. Select the cells where you want to add spaces.
  2. Click Kutools > Text > Add Text.
  3. In the Text box, press the Space key once.
  4. Select Only add to.
  5. From the drop-down list, choose Before uppercase/lowercase letters.
  6. Click OK.
    Case 1: Add spaces between letters

Result: Spaces are added before letters, creating a separated-letter effect.
Spaces are added before letters

Best for: The Before uppercase/lowercase letters option is better when you want to add spaces before alphabetic characters only. It is especially suitable for words, letters, and text strings.

Case 2: Add spaces between every character

If your data contains both letters and numbers, and you want to separate every single character, use the Between characters option.

Recommended option: Between characters

  1. Select the cells that contain the text strings or mixed codes.
  2. Click Kutools > Text > Add Text.
  3. In the Text box, press the Space key once.
  4. Select Only add to.
  5. From the drop-down list, choose Between characters.
  6. Click OK.
    Case 2: Add spaces between every character

Result: A space is inserted between every character, including letters and numbers.
A space is inserted between every character, including letters and numbers

Best for: Use Between characters when you want to separate every character in a string, including letters, numbers, and symbols.

Case 3: Add spaces before numeric characters

Recommended option: Before numeric characters

  1. Select the cells that contain text and numbers.
  2. Click Kutools > Text > Add Text.
  3. In the Text box, press the Space key once.
  4. Select Only add to.
  5. From the drop-down list, choose Before numeric characters.
  6. Click OK.
    Case 3: Add spaces before numeric characters

Result: A space is added before each numeric character.
A space is added before each numeric character

Best for: The Before numeric characters option adds the specified text before each numeric character. For example, Item123 becomes Item 1 2 3, not Item 123.

Case 4: Add another separator instead of a space

Besides spaces, the Add Text feature can also insert other separators, such as hyphens, slashes, or commas. Instead of pressing the Space key in the Text box, type the separator you want to insert, and then choose the suitable option under Only add to, such as Before uppercase/lowercase letters, Between characters, or Before numeric characters.
Case 4: Add another separator instead of a space

Result: Kutools inserts the separator you entered based on the option you choose. For example, if you type a hyphen and choose Between characters, ABCDE becomes A-B-C-D-E.
Kutools inserts the separator you entered based on the option you choose

Best for: Use Kutools for Excel when you want to batch add spaces or other separators to many cells, and choose flexible position options such as Before uppercase/lowercase letters, Between characters, or Before numeric characters.
βœ… Pros
  • Batch adds spaces to all selected cells in one go
  • No formulas, VBA, or macro knowledge required
  • Lets you add spaces before letters, between every character, or before numeric characters
  • Works with normal text, number strings, mixed codes, product IDs, and serial numbers
  • Can insert other separators, such as hyphens, slashes, or commas, instead of spaces
  • More flexible than formulas when different text-position rules are needed
  • Easy to use with a clear dialog box and preview-style settings
 
Kutools for Excel
Batch add spaces or separators to letters, numbers, and mixed text strings with flexible position options β€” no formulas or VBA required.

Method 3: Add spaces between characters with VBA

If you use an older Excel version or prefer a reusable custom function, you can use VBA to add spaces between characters.

  1. Press Alt + F11 to open the Microsoft Visual Basic for Applications window.
  2. Click Insert > Module.
  3. Paste the follwing VBA code into the module.
  4. Function AddSpace(Str As String) As String
    'Updated by Extendoffice 2026/5/19
        Dim i As Long
        For i = 1 To Len(Str)
            AddSpace = AddSpace & Mid(Str, i, 1) & " "
        Next i
        AddSpace = Trim(AddSpace)
    End Function
    
  5. Press Alt + Q to return to the worksheet.
  6. In a blank cell, enter the following formula:
  7. =AddSpace(A2)
  8. Press Enter and drag the formula down to apply it to other cells.

Result: The custom function adds a space between each character in the text string.
The custom function adds a space between each character in the text string

Limitations of VBA

  • It requires working with macros and code.
  • You may need to save the workbook as a macro-enabled file.
  • Other users may need to enable macros before the custom function works.
  • It may feel difficult for beginners who are not familiar with VBA.
  • It is less convenient if you need to repeat this task often or apply different spacing rules.

Which method should you use?

Different methods are suitable for different Excel versions and data-cleaning needs. Use the comparison below to choose the best method for your situation.

MethodBest ForAdvantagesLimitations
FormulaQuick results in Microsoft 365 or Excel 2021+βœ… No VBA required; dynamic and easy to edit❌ Requires modern Excel functions; separates every character without flexible position options
Kutools for ExcelBatch adding spaces or separators with flexible position rulesβœ… No formulas or VBA; supports options such as Before uppercase/lowercase letters, Between characters, and Before numeric charactersRequires Kutools for Excel, but provides a much easier and more flexible way to handle different spacing needs
VBAOlder Excel versions or reusable custom functionβœ… Works as a custom worksheet function❌ Requires macros; may be difficult for beginners

Frequently asked questions

1. How do I add spaces between every character in Excel?

In Microsoft 365 or Excel 2021 and later versions, you can use this formula:

=TEXTJOIN(" ",TRUE,MID(A2,SEQUENCE(LEN(A2)),1))

For example, ABCDE becomes A B C D E.

2. How do I add spaces between every digit in Excel?

If the cell contains only digits, use the same formula:

=TEXTJOIN(" ",TRUE,MID(A2,SEQUENCE(LEN(A2)),1))

For example, 123456 becomes 1 2 3 4 5 6.

3. How do I add spaces between letters only?

With Kutools for Excel, use Add Text > Only add to > Before uppercase/lowercase letters. This is useful when you want to add spaces before alphabetic characters rather than before every number or symbol.

4. How do I add spaces between every character in mixed text and numbers?

With Kutools for Excel, use Add Text > Only add to > Between characters. This separates every character, including letters, numbers, and symbols. For example, A1B2C3 becomes A 1 B 2 C 3.

5. How do I add spaces before numbers in Excel?

With Kutools for Excel, use Add Text > Only add to > Before numeric characters. For example, Item123 becomes Item 1 2 3.

6. Why does Kutools add spaces before every digit instead of before the whole number?

Because Before numeric characters targets each numeric character individually. So SKU2026 becomes SKU 2 0 2 6, not SKU 2026.

7. Can I add hyphens or slashes instead of spaces?

Yes. In the formula, replace the space inside " " with another separator such as "-" or "/". In Kutools, type the separator you want into the Text box instead of pressing the Space key.

OriginalSeparatorResult
ABCDE-A-B-C-D-E
123456/1/2/3/4/5/6

8. Can I add spaces after every 3 or 4 characters?

Yes, but that is a different formatting task. For example, you may want to change 123456789012 to 1234 5678 9012. In that case, use a method designed to insert spaces after every fixed number of characters.