Formatting Issues

Convert Text or Numbers to a Colon-Separated MAC Address in Excel

Natalie TaylorNatalie Taylor Dec 2, 2026 868 views

Question details

Convert a 12-character MAC address into six colon-separated pairs.

Convert Text or Numbers to a Colon-Separated MAC Address in Excel
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.
Before you start

Place each MAC address in its own cell. To preserve leading zeros, format the input column as Text before entering or pasting the addresses.

Solution 1Recommended

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.

1
Enter the address

Enter the unseparated MAC address in cell A2. If possible, set the input column to Text before entering the value.

2
Insert the formula

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)))))

3
Apply it to other rows

Drag the fill handle from B2 down the output column. For example, 001f55417793 becomes 00:1f:55:41:77:93.

Use a formula to format MAC addresses in Excel 365
Check the source values: If an address is shorter than 12 characters for a reason other than missing leading zeros, correct it before relying on the result.
Format MAC addresses in WPS Spreadsheets

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. 1. Prepare the input column: In WPS Spreadsheets, select column A, open Format Cells, and choose Text.
  2. 2. Enter the addresses: Enter or paste each complete 12-character MAC address into column A, starting in A2.
  3. 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. 4. Format the remaining rows: Drag the fill handle from B2 down column B to apply the formula to the other addresses.
Format MAC addresses with a formula using MID.Preserve leading zeros by entering addresses as text.Open and save Microsoft Excel XLSX files.Fill the formula down to format multiple rows.
microsoft office alternative - wps office

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.