|

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

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.

GoalCommand
List MAC addressesgetmac
Verbose outputgetmac /v
Table without a header rowgetmac /fo table /nh
Output as CSVgetmac /fo csv
Output as a listgetmac /fo list
Query another computergetmac /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

  1. Select Start and type Command Prompt.
  2. Open the Command Prompt result.
  3. Type getmac and 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

ParameterWhat 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.
/nhHides the column header. Valid only when /fo is table or csv.
/vShows 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 /v

Use 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.

ValueOutput
tableColumn-formatted output, and the default
listOne labeled item per line
csvComma-separated values you can paste into a spreadsheet
getmac /fo csv

The 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 /v

This 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 srvmain

Microsoft’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\hiropln

Microsoft 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

CommandWhat it does
getmac /fo table /nh /vVerbose table output with no header
getmac /s srvmainLists addresses on the computer srvmain
getmac /s srvmain /u maindom\hiroplnSame, using the account hiropln in the domain maindom
getmac /s srvmain /u maindom\hiropln /p password /fo list /vRemote query as that user, as a verbose list
getmac /s srvmain /u maindom\hiropln /p password /fo table /nhRemote query as that user, as a table with no header

Mistakes to avoid

MistakeWhat Microsoft says
Adding backslashes to the computer name after /sDo 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 listThe 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.

CommandBest for
getmacA short list of MAC addresses, including from a remote PC
ipconfig /allThe 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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *