Cart0

Office · guide · 6 min read

How to Remove an Office Product Key

Updated

How to Remove an Office Product Key

Short answer: To remove an Office product key, open Command Prompt as administrator and go to the Office16 folder. We'd run the status line of the licensing script to see each key's last five characters. With those, the uninstall switch removes the key. Then enter the right one and activate.

To remove an Office product key you need two lines of the Office licensing script. The first lists the installed keys. The second uninstalls the one you name. Close Office first. Works on volume and key-activated editions, not on Microsoft 365.

Situation What to do
A wrong or old key keeps Office unlicensed Uninstall that key, then enter the right one
Two licenses fight each other after an upgrade Uninstall the one you don’t use
The PC changes hands Uninstall the key, or uninstall the suite
Microsoft 365 or a Home edition No key to remove; sign out or remove the device in your account

Removing a key doesn’t delete the apps or your files. The suite simply goes back to “unlicensed” until it gets a key again.

When removing the key helps

A PC can hold more than one Office license at a time. It happens after an upgrade, after a trial, or when a volume edition was installed over a retail one.

The apps then pick one of them, and not always the one you paid for. The usual signs:

  • “Unlicensed Product” although a valid key was entered.
  • A request to activate at every start.
  • File, Account names a different edition than the one you bought.
  • Error 0x4004F00C that doesn’t go away.

Clearing out the stray key is the fix. It beats a full reinstall by about half an hour.

Table comparing removing an Office product key with uninstalling Office: what each touches, what happens afterwards, when to use it and how
Illustration: removing the Office product key touches the license only, while uninstalling removes the apps as well.

How to remove an Office product key

Close all Office apps first. Then:

  1. Press Start, type cmd, right-click Command Prompt and choose Run as administrator.
  2. Go to the Office folder that holds the licensing script.
  3. Run the status line and find the license you want gone.
  4. Note the last five characters of its installed product key.
  5. Run the uninstall line with those five characters.
  6. Run the status line again; that license should no longer be listed.
  7. Enter the right key, activate and check once more.
cd "C:\Program Files\Microsoft Office\Office16"
cscript ospp.vbs /dstatus
cscript ospp.vbs /unpkey:XXXXX
cscript ospp.vbs /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
cscript ospp.vbs /act
Line What it does
cd with the folder Goes to the script; 32-bit Office on 64-bit Windows keeps it under Program Files (x86), and some installs add a “root” folder in between
/dstatus Lists installed licenses with name, status and the last five characters of each key
/unpkey Uninstalls the key that ends in the five characters after the colon
/inpkey Installs a new key
/act Asks for activation
Five numbered steps to remove an Office product key with the licensing script: administrator prompt, Office folder, /dstatus, /unpkey with the last five characters and a final status check
Illustration: we uninstall an Office product key by its last five characters and check the status again.

These switches are Microsoft’s own. They’re described in its article on tools to manage volume activation of Office.

Reading the status output

Each license gets its own block in the answer. Three lines matter.

Line in the output What it tells you
LICENSE NAME Which product and channel the license belongs to
LICENSE STATUS LICENSED, or a grace or notification state
Last 5 characters of installed product key What you type after the uninstall switch

Two blocks in the list? That’s the conflict. Keep the one that says LICENSED for the edition you own, and remove the other.

Not sure which is which? Compare the five characters with the end of the key in your order email.

Where you can’t remove an Office product key with the script

The script works for volume and key-activated editions. Microsoft notes that it doesn’t work for Microsoft 365 Apps.

Product How the license is released
Professional Plus and LTSC editions The uninstall switch on this page
Microsoft 365 Sign out in the app, and sign the device out in your Microsoft account
Home editions tied to an account Uninstall the suite; the license stays in your account for the next install
Work installs IT’s task

For Microsoft 365, the sign-out sits under File, Account in any app. The list of signed-in devices is in the subscription section of your Microsoft account.

After you remove the Office product key

What you see Why
“Unlicensed Product” in the title bar No license is installed now; enter the new key
Editing is switched off The same reason
The other edition activates by itself The remaining license took over, as intended

The steps for entering a key are in how to activate Office 2024 and how to activate Office 2021. If the title bar message stays, see Unlicensed Product.

Need the key that replaces it? Ours are genuine and arrive instant to email: Office LTSC Professional Plus 2024 or, for less, Office 2019 Professional Plus.

Moving Office to another PC

A one-time purchase covers one computer at a time. Removing the key on the old PC is the tidy first step of a move.

  • Remove the key or uninstall the suite on the old PC.
  • Install on the new PC.
  • Enter the key and activate.

Whether your license may move at all is covered in moving Office to a new computer.

When a clean sweep is better

Several old versions, a trial from the PC maker and a failed setup on top: at that point removing keys one by one stops paying off.

Uninstall everything with Microsoft’s tool, restart and install the one edition you own. Our guide to the Office uninstall tool walks through it.

Setup errors along the way have their own pages: Office error 30068-4 and Office error 30015-11. Activation that fails afterwards is in Product Activation Failed.

Where the steps to remove an Office product key apply

Product Notes
Office LTSC 2024 and 2021, Office 2019, Office 2016 All steps as written
Professional Plus editions All steps as written
Project and Visio The same script; they appear as their own blocks
Microsoft 365 Not with this script

Common mistakes when you remove an Office product key

  • Running the script in a normal prompt.
  • Removing the licensed key and keeping the stray one.
  • Typing the whole key after the uninstall switch; it wants five characters.
  • Looking for the script in the wrong Program Files folder.
  • Expecting the switch to work for Microsoft 365.
  • Removing a key that isn’t written down anywhere.

Change Office product key from File, Account

The easy route. Works on recent one-time Office versions for home and business. Single apps bought on their own too.

Change Office product key in Word: File, Account, Switch License, then Enter product key instead
Illustration: where Switch License sits in an Office app and the three steps after it.
  1. Open any Office app. Word is fine.
  2. File, then Account, near the bottom of the menu.
  3. Under Product Information, press Switch License.
  4. Signed in? Choose “Use a different account”, then “Enter product key instead”. Not signed in? Go straight to “Enter product key instead”.
  5. Type the 25-character key and press “Install this product instead”.
  6. Office updates itself. Close every Office app so it can finish.

A brand-new key asks you to redeem it on the way. Sign in, confirm, and the license lands on your Microsoft account. That account is how you reinstall later, so we’d use the one you actually keep.

Files aren’t touched. Only the license underneath Word and Excel changes.

No Switch License button in Office

Usually an old build. Microsoft’s answer: install Office updates first.

Install the latest Office updates. Restart the app and look again.

Still missing? Check what kind of Office you have:

  • Volume Professional Plus or LTSC. Microsoft’s Switch License steps don’t cover volume editions. Skip to the volume section below.
  • Office 2016 with a product key on the box. The command line is the way.
  • Microsoft 365 through work or school. Your admin assigns the license, not a key.

Microsoft 365: switch the account, not the key

A subscription doesn’t live on a key inside Office. It lives on the account you sign in with.

Wrong subscription showing? File, Account, Sign out. Then sign in with the account that pays for the right plan.

Moving between Microsoft 365 and Office 2024 or 2021 uses the same Switch License button. Sign in with the account that owns the license you want. Volume editions? Not this way.

Weighing the two? Our Microsoft 365 vs Office 2024 comparison lays it out.

Change the Office product key on a Mac

No key box inside Mac Office. The license follows your Microsoft account.

Redeem the new key first, then open Word and sign in with that account. Mac Office still on the old license? Microsoft has a license removal tool for that case:

  1. Quit all Office apps.
  2. Download the tool from the Office license files on a Mac page.
  3. Open the .pkg file and follow the prompts. Your Mac password may be needed.
  4. Drag the removal file to the Trash when it’s done.
  5. Open Word and sign in with the account that holds the new license.

Account holds both a subscription and a one-time purchase? Office asks which to use. Restart the Mac after it activates.

Redeem a new key before you switch

A new retail key for Office 2024 or 2021 is redeemed at setup.office.com with a Microsoft account. After that the key and the account are tied together.

Lost track of which key is which? Sign in to account.microsoft.com/services, then View product key. Our guide on finding an Office product key lists every other place one can hide. Moving Office to a new PC instead? The Office transfer guide fits better.

If Office rejects the new key

Setup page errors? Our list of Office.com/setup errors covers the redeem step.

Terms used on this page

Term Meaning
Licensing script The script in the Office folder that installs, removes and shows keys
Partial key The last five characters of an installed key
License block The part of the status output that describes one license
Unlicensed Product The state in which editing is switched off
Volume edition An edition licensed to organisations, activated with a key in the app or a company server

FAQ

How do I remove an Office product key?

Run the Office licensing script as administrator. The dstatus switch lists the installed keys by their last five characters. The unpkey switch, followed by those five characters, uninstalls that key.

Where is ospp.vbs?

In the Office16 folder of the Office installation, under Program Files. Per Microsoft, a 32-bit Office on 64-bit Windows keeps it in the x86 variant of that folder. Some installs have a "root" folder in between.

Will removing the key delete Office or my files?

No. Only the license is removed. The apps stay installed and your documents aren't touched. Until a key is entered again, we'd expect the Unlicensed Product message.

Why does Office have two keys installed?

Usually an upgrade or a trial left its license behind, or a second edition was installed over the first. The status line shows a block for each. We'd remove the one that isn't yours.

Can I remove a Microsoft 365 license this way?

No. Microsoft says the script doesn't work for Microsoft 365 Apps. There's no key to uninstall. We'd sign out in the app and sign the device out in the Microsoft account.

Do I need the full key to remove it?

No, only its last five characters. The status line prints them for every installed key. That's also how we tell two licenses apart when the full keys aren't at hand.

Can I use the key on another PC after removing it?

If the license allows a move, yes. A one-time purchase covers one computer at a time. After removing it here, we'd install on the other PC and activate there.

can I change the key without reinstalling Office?

Yes. Switch License under File and Account, or ospp.vbs on volume editions, swaps it in place.