To get your computer's serial number using a Windows command, open the Command Prompt and type wmic bios get serialnumber, then press Enter. This command queries the Windows Management Instrumentation (WMI) to pull the unique hardware identifier stored in your system's BIOS or UEFI, allowing you to identify your machine for warranty claims or driver updates without needing to find a physical sticker on the chassis.

What You'll Need

  • A computer running a version of Windows (Windows 10, Windows 11, or older versions).
  • Administrative access to the machine (while the basic command often works for standard users, some system queries require elevated permissions).
  • A keyboard and screen that are functioning correctly.

Step-by-Step

  1. Open the Start Menu: Click the Windows icon in the bottom-left corner of your screen or press the Windows key on your keyboard.
  2. Search for Command Prompt: Type "cmd" into the search bar. You will see the "Command Prompt" app appear in the results.
  3. Run as Administrator: Right-click on "Command Prompt" and select "Run as administrator." A User Account Control (UAC) prompt will appear asking if you want to allow this app to make changes to your device; click "Yes." Running as an administrator ensures that the system does not block the request to access BIOS information.
  4. Enter the WMIC Command: In the black terminal window, type the following command exactly as shown: wmic bios get serialnumber. Note that there is a space between "wmic", "bios", "get", and "serialnumber".
  5. Execute the Command: Press the Enter key on your keyboard.
  6. Read the Output: The Command Prompt will display the heading "SerialNumber" and, directly beneath it, a string of alphanumeric characters. This string is your device's unique hardware serial number.
  7. Alternative Method (PowerShell): If you prefer using PowerShell, right-click the Start button and select "Windows PowerShell (Admin)" or "Terminal (Admin)". Type the command Get-CimInstance Win32_Bios | Select-Object SerialNumber and press Enter. This provides the same result using a more modern framework.

Common Mistakes

One of the most frequent errors is a typo in the command. The wmic tool is very specific about syntax. If you type serial-number (with a hyphen) instead of serialnumber (one word), Windows will return an "Invalid class" or "No instance(s) available" error. Always ensure there are no hyphens or underscores in the word "serialnumber".

Another common mistake is failing to run the Command Prompt as an administrator. While some laptop manufacturers allow standard users to read the BIOS serial number, many enterprise-grade machines or those with strict security policies will return an "Access Denied" message. If you see a permission error, close the window and restart it using the "Run as administrator" option.

Users often confuse the Windows Product Key with the Hardware Serial Number. The Product Key is a 25-character code used to activate the Windows operating system software. The Serial Number (or Service Tag) is a hardware identifier assigned by the manufacturer (like Dell, HP, or Lenovo) to the physical motherboard and chassis. The wmic bios command retrieves the hardware ID, not the software license key.

Tips

If you need to save this serial number for your records, you do not have to write it down by hand. You can highlight the serial number in the Command Prompt window using your mouse, then right-click to copy the text. You can then paste it into a Notepad file or an email. Alternatively, you can export the result directly to a text file by adding a redirection operator to the command: wmic bios get serialnumber > serial.txt. This creates a file named "serial.txt" in your current folder containing the number.

For those managing multiple computers, the PowerShell method is generally superior because it integrates better with scripts. If you are an IT administrator, you can use the Get-CimInstance command across a network to pull serial numbers from multiple remote machines simultaneously, which is far more efficient than visiting each physical desk.

If you are using a custom-built PC, be aware that the serial number returned by this command may be "Default string" or "To be filled by O.E.M." This happens because custom motherboards often do not have a system-wide serial number programmed into the BIOS by a single manufacturer. In these cases, you will need to look for the serial number printed on the physical motherboard or the original box the motherboard came in.

Troubleshooting

If the command returns "To be filled by O.E.M." or "Default string," it does not mean the command failed; it means the manufacturer did not hard-code a serial number into the BIOS. This is extremely common with white-box PCs and custom builds. To find your serial number in this scenario, you must check the physical sticker on the back or bottom of the computer case, or check the BIOS/UEFI menu during the boot process (usually by pressing F2, F12, or Del during startup).

If you receive an "Invalid Class" error, it may indicate that the WMI repository on your Windows installation is corrupted. You can attempt to repair the WMI repository by opening the Command Prompt as an administrator and typing winmgmt /salvagerepository. After running this, restart your computer and try the wmic bios get serialnumber command again.

If the Command Prompt window closes immediately after you run the command, it is likely because you are running the command from a shortcut or a batch file without a "pause" command. To prevent this, open the Command Prompt first, and then type the command manually. This ensures the window stays open so you can read the output.

If you are using a virtual machine (VM), the serial number returned will be a virtualized ID generated by the hypervisor (such as VMware or Hyper-V) rather than a physical hardware ID. This is normal behavior for virtualized environments.

Frequently Asked Questions

Can I find my serial number if Windows won't boot?

Yes. If you cannot access the Windows desktop, you can enter the BIOS/UEFI menu by pressing a specific key (usually F2, F10, or Del) immediately after powering on the machine. The serial number or service tag is almost always listed on the main information page of the BIOS.

Is the serial number the same as the UUID?

No. The serial number is a manufacturer-assigned ID for the device. The UUID (Universally Unique Identifier) is a software-level unique ID for the system. You can find the UUID using the command wmic csproduct get uuid.

Does this command work on Macs running Windows via Boot Camp?

Yes, the wmic command generally works on Boot Camp installations, as it queries the firmware. However, the output may differ depending on how Apple exposes the hardware information to the Windows environment.

Will this command show the serial number of my RAM or Hard Drive?

No. The wmic bios command only retrieves the system-wide serial number. To get the serial number of a hard drive, you would use wmic diskdrive get serialnumber. For RAM, the process is more complex and may require third-party tools as RAM modules often do not expose serials via standard WMI classes.

Is it safe to share my serial number?

Generally, yes, but only with official support channels. A serial number cannot be used to hack into your computer, but it can be used to check warranty status or report a device as stolen. Avoid posting it on public forums.