Convert Text or Numbers to a Colon-Separated MAC Address in Excel
Question details
Convert a 12-character MAC address into six colon-separated pairs.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains MAC addresses such as 001f55417793 that need to appear as 00:1f:55:41:77:93.
- Observed behavior
- The desired output is a colon-separated MAC address that preserves hexadecimal letters and leading zeros.
Place each MAC address in its own cell. To preserve leading zeros, format the input column as Text before entering or pasting the addresses.
Use a formula to format MAC addresses in Excel 365
Use this formula when addresses may have lost leading zeros and you want to pad them to 12 characters.
The formula assumes that any missing characters are leading zeros. It checks for inputs longer than 12 characters but does not validate whether every character is hexadecimal.
Enter the unseparated MAC address in cell A2. If possible, set the input column to Text before entering the value.
Select B2 and enter =IF(A2="","",IF(LEN(A2)>12,"Check input",LET(mac,A2,padded,IF(LEN(mac)<12,REPT("0",12-LEN(mac))&mac,mac),TEXTJOIN(":",TRUE,MID(padded,SEQUENCE(6,1,1,2),2)))))
Drag the fill handle from B2 down the output column. For example, 001f55417793 becomes 00:1f:55:41:77:93.

Use MID to format MAC addresses in older Excel versions
Use this approach when LET or SEQUENCE is unavailable and each input already contains all 12 characters.
Create colon-separated MAC addresses in WPS Spreadsheets
Use a MID formula in WPS Spreadsheets to split a complete 12-character MAC address into six pairs.
- 1. Prepare the input column: In WPS Spreadsheets, select column A, open Format Cells, and choose Text.
- 2. Enter the addresses: Enter or paste each complete 12-character MAC address into column A, starting in A2.
- 3. Add the formula: Select B2 and enter =MID(A2,1,2)&":"&MID(A2,3,2)&":"&MID(A2,5,2)&":"&MID(A2,7,2)&":"&MID(A2,9,2)&":"&MID(A2,11,2)
- 4. Format the remaining rows: Drag the fill handle from B2 down column B to apply the formula to the other addresses.

Frequently Asked Questions
Why should I format the input column as Text?
Text formatting preserves leading zeros when you enter or paste an address. Select the input column, open Format Cells, and choose Text before entering the values.
Can a custom number format handle hexadecimal MAC addresses?
Custom number formats are not reliable for addresses containing hexadecimal letters. Use a formula that joins pairs of characters with colons instead.
How can I display the result in uppercase?
Wrap the formatting formula in UPPER, for example, =UPPER(B2) in another cell, to display 00:1F:55:41:77:93.
Does padding a short value guarantee a valid MAC address?
No. Padding assumes that missing characters are leading zeros, and the formula does not check for invalid hexadecimal characters. Verify the source address if you are unsure.




