How To Use The Getmac Command In Windows (2026)
Getmac is a built-in Windows command that lists the MAC address of each network adapter on a computer.
It can also read the same information from a remote computer on your network.
This guide covers every parameter Microsoft documents for it.
Table of Contents
- Getmac quick answer
- What the getmac command does
- Open Command Prompt and run getmac
- Getmac syntax
- Getmac parameters
- Show verbose output with /v
- Change the output format with /fo
- Hide the header row with /nh
- Get the MAC address of a remote computer
- Microsoft’s example commands
- Mistakes to avoid
- Compare getmac with ipconfig /all
- Why your MAC address may differ per Wi-Fi network
- Related commands to try next
- Sources
- More Windows guides
Getmac quick answer
Open Command Prompt, type getmac and press Enter to list the MAC addresses of the network adapters on your PC.
Add /v for verbose output, or use the switches below to change the format.
| Goal | Command |
|---|---|
| List MAC addresses | getmac |
| Verbose output | getmac /v |
| Table without a header row | getmac /fo table /nh |
| Output as CSV | getmac /fo csv |
| Output as a list | getmac /fo list |
| Query another computer | getmac /s computername |
What the getmac command does
The Microsoft Learn getmac page says getmac returns the media access control (MAC) address and the list of network protocols associated with each address for all network cards in a computer.
It works for cards in the local computer and for cards in a remote computer.
A MAC address is the hardware address of a network adapter, which is why you often need it for router filters or network inventories.
Open Command Prompt and run getmac
- Select Start and type Command Prompt.
- Open the Command Prompt result.
- Type
getmacand press Enter.
Getmac reports on the network cards in the computer.
You do not need to add any switches for a basic lookup.
Getmac syntax
Microsoft documents the command with this syntax.
getmac[.exe] [/s <computer> [/u <domain\user> [/p <password>]]] [/fo {table | list | csv}] [/nh] [/v]Every part in square brackets is optional, so plain getmac with nothing after it is a complete command.
Getmac parameters
| Parameter | What it does |
|---|---|
| /s <computer> | Names or gives the IP address of a remote computer. Do not use backslashes. The default is the local computer. |
| /u <domain>\<user> | Runs the command with the permissions of the account you name. The default is the signed-in user. |
| /p <password> | Gives the password for the account named in /u. |
| /fo {table | list | csv} | Sets the output format. The default is table. |
| /nh | Hides the column header. Valid only when /fo is table or csv. |
| /v | Shows verbose information in the output. |
| /? | Shows help at the command prompt. |
Microsoft lists /s, /u and /p as the group you use together for remote queries.
Show verbose output with /v
The /v switch adds more detail to the output than the default listing.
getmac /vUse it when a PC has several adapters and you need to tell which address belongs to which one.
Change the output format with /fo
The /fo switch picks how getmac prints its results.
| Value | Output |
|---|---|
| table | Column-formatted output, and the default |
| list | One labeled item per line |
| csv | Comma-separated values you can paste into a spreadsheet |
getmac /fo csvThe CSV format is the easiest one to open in a spreadsheet.
Hide the header row with /nh
The /nh switch removes the column header from the output.
Microsoft says it works only when /fo is table or csv, so it will not do anything with the list format.
getmac /fo table /nh /vThis is the first example on Microsoft’s page, and it combines a table, no header and verbose output in one command.
Get the MAC address of a remote computer
Add /s followed by the computer name or IP address to query another machine.
getmac /s srvmainMicrosoft’s example uses a computer named srvmain, so replace it with your own computer name.
To use another account, add /u with the domain and user name.
getmac /s srvmain /u maindom\hiroplnMicrosoft lists /p as the way to include that account’s password in the command.
Typing a password into a command leaves it in plain text on screen, so avoid that on a shared PC.
Microsoft’s example commands
| Command | What it does |
|---|---|
getmac /fo table /nh /v | Verbose table output with no header |
getmac /s srvmain | Lists addresses on the computer srvmain |
getmac /s srvmain /u maindom\hiropln | Same, using the account hiropln in the domain maindom |
getmac /s srvmain /u maindom\hiropln /p password /fo list /v | Remote query as that user, as a verbose list |
getmac /s srvmain /u maindom\hiropln /p password /fo table /nh | Remote query as that user, as a table with no header |
Mistakes to avoid
| Mistake | What Microsoft says |
|---|---|
| Adding backslashes to the computer name after /s | Do not use backslashes there, only the name or IP address |
| Using /nh with /fo list | /nh is valid only with the table and csv formats |
| Using /p without an account | /p is the password for the account you name with /u |
| Expecting the default format to be a list | The default format is table |
Check these four points first if a getmac command does not return what you expect.
Run getmac /? any time to see the built-in help on your own PC.
Compare getmac with ipconfig /all
Microsoft says ipconfig /all displays the full TCP/IP configuration for all adapters, physical or logical.
Getmac is narrower, because it focuses on the hardware address and protocols.
| Command | Best for |
|---|---|
getmac | A short list of MAC addresses, including from a remote PC |
ipconfig /all | The full TCP/IP settings of every adapter |
For step-by-step ways to find both an IP and a MAC address in Windows 11, see our guide to finding your IP and MAC address in Windows 11.
Why your MAC address may differ per Wi-Fi network
Microsoft explains that random hardware addresses make it harder for places like stores to track your device by its MAC address.
The setting is under Settings > Network & internet > Wi-Fi > Random hardware addresses.
You can also set it for one network under Manage known networks.
Microsoft notes this depends on your Wi-Fi hardware supporting it.
If a router filter expects a fixed MAC address, check that setting for that network first.
Related commands to try next
Once you know the address, you can pair getmac with other network tools.
- Use nslookup to look up a host name or IP address
- Use ping and tracert to test a connection
- Use a static IP address if a device needs a fixed address
Our guides cover each of those tools in the same step-by-step way.
Sources
The syntax, parameters and examples come from the Microsoft Learn getmac page.
The random hardware address steps come from Microsoft Support.
More Windows guides
- How To Use The Arp Command In Windows (2026)
- How To Use The Driverquery Command In Windows (2026)
- How To Use The Schtasks Command In Windows (2026)
- How To Use The Whoami Command In Windows (2027)
- How To Use The Reg Add Command In Windows (2027)
- How To Use The Net Localgroup Command In Windows (2027)
See all: Windows 11 Guides