Format MAC Addresses#
The format command standardizes MAC address notation using configurable separators, block sizes, and hexadecimal casing.
It supports individual and bulk input, with optional correction of supported typing mistakes.
Unlike validate, which identifies malformed addresses, format focuses on transforming their textual representation without performing address validation.
Basic usage#
Format a single MAC address:
etherlyzer format 001122334455
Output:
00:11:22:33:44:55
By default, addresses are formatted using lowercase hexadecimal, colon separators, and two-character blocks.
Use -b or --bulk to format multiple addresses interactively:
etherlyzer format -b
Customize formatting#
The command provides three independent formatting controls:
Option |
Purpose |
Default |
|---|---|---|
|
Character separating hexadecimal blocks |
|
|
Number of hexadecimal characters per block |
|
|
Lowercase or uppercase hexadecimal |
|
Formatting examples#
For the input aabbccddeeff:
Purpose |
Options |
Output |
|---|---|---|
Default notation |
None |
|
Hyphen separators |
|
|
Period separators |
|
|
Cisco-style notation |
|
|
Four-character blocks |
|
|
Uppercase hexadecimal |
|
|
Uppercase Cisco notation |
|
|
No separators |
|
|
These options can be combined to produce the desired output notation.
Common commands#
Purpose |
Command |
|---|---|
Format a single address |
|
Format multiple addresses |
|
Use hyphen separators |
|
Use Cisco-style notation |
|
Use uppercase hexadecimal |
|
Remove separators |
|
Note
Formatting changes the textual representation of an address, not its underlying hexadecimal value.
For example, aa:bb:cc:dd:ee:ff and AABB.CCDD.EEFF represent the same 48-bit address.
Typo correction#
Use -f or --fix-typos to enable correction of supported typo-like character substitutions before formatting.
This is useful when processing addresses copied from documents, spreadsheets, or manually entered inventories.
Purpose |
Command |
|---|---|
Enable typo correction |
|
Correct typos in bulk input |
|
Correct typos and use uppercase |
|
Correct typos and use Cisco notation |
|
Typo correction is optional and must be explicitly enabled.
Important
The format command does not validate MAC addresses. Enabling typo correction may change how the original input is interpreted.
Use validate when malformed entries must be identified rather than corrected.
Practical workflows#
Standardize a MAC address inventory#
When working with addresses collected from different sources, use bulk formatting to produce consistent notation:
etherlyzer format -b -c upper
This is useful for inventories containing a mixture of colon-separated, hyphen-separated, and Cisco-style addresses.
Prepare addresses for Cisco-style notation#
Use four-character hexadecimal blocks separated by periods:
etherlyzer format -b -p . -s 4
For example:
aabbccddeeff → aabb.ccdd.eeff
Normalize manually entered addresses#
Enable supported typo correction while applying standardized formatting:
etherlyzer format -bf -c upper
For workflows where input integrity is more important than correcting possible mistakes, use validate instead.
Command reference#
usage: etherlyzer format [-h] [-b] [-p SEPARATOR] [-s BLOCK_SIZE]
[-c {lower,upper}] [-f] [mac]
Argument / Option |
Description |
|---|---|
|
MAC address to format. |
|
Read multiple MAC addresses interactively. |
|
Set the separator to |
|
Set hexadecimal characters per block (default: |
|
Set hexadecimal casing (default: |
|
Correct supported typo-like character substitutions before formatting. |
|
Display command help. |
Provide a positional MAC address for individual formatting, or use -b for interactive bulk processing.