0X8028005A

TPM_E_BADCONTEXT (0X8028005A) Fix

This error means TPM context data is corrupted. Usually from sleep/resume cycles or BIOS updates. Wiping the TPM and re-owning it fixes it.

Quick Answer

Open tpm.msc, click "Clear TPM", reboot, then reinitialize in BIOS.

Why This Happens

The TPM stores cryptographic keys in a "context blob" – think of it as a session token. Error 0x8028005A pops up when that blob gets corrupted. I've seen this most often after a BIOS update that resets TPM firmware tables, or after a hard crash during encryption (like a power loss while BitLocker was running). A common real-world trigger: putting a laptop to sleep with BitLocker active, then waking it after a BIOS update.

The culprit here is almost always a mismatch between what the TPM hardware expects and what Windows sent it. You can't repair the blob – it's like trying to fix a shredded PDF. You clear the TPM and start fresh.

Fix Steps

  1. Back up BitLocker keys. If you use BitLocker, get your recovery key first. Press Windows+R, type manage-bde -protectors -get C:, save the 48-digit key. Without this, you'll lose the drive if you clear TPM.
  2. Open TPM Management. Press Windows+R, type tpm.msc, hit Enter. Look at the status. If it says "The TPM is ready for use", good. If it shows any error, skip to step 4.
  3. Clear the TPM. In tpm.msc, click "Clear TPM" in the right Actions pane. Check "I have the TPM owner password" – you don't need it unless you set one. Click OK. Reboot when prompted. During POST, you'll see a prompt to press F12 or Delete to confirm the clear. Do it.
  4. If tpm.msc fails – sometimes the UI just errors out. Use PowerShell as Admin: Clear-Tpm. If that returns "The TPM is not ready", you need to initialize it in BIOS.
  5. Initialize TPM in BIOS. Reboot, mash F2/Del/F10 (varies by brand). Find Security or TPM settings. Set TPM to "Enabled" or "Available". Save and exit. Boot to Windows.
  6. Reinitialize TPM. Open PowerShell (Admin): Initialize-Tpm -AllowClear. This provisions the TPM. Then run Get-Tpm – status should show "$true" for all fields.
  7. Restore BitLocker. If you use BitLocker, run manage-bde -on C: and enter your recovery key when prompted. It'll re-encrypt using the new TPM.

Alternative Fixes if the Main One Fails

If clearing the TPM doesn't work or the error persists, try these:

  • Disable TPM in BIOS, reboot, then re-enable. I've seen this kickstart a stuck TPM. Boot to BIOS, set TPM to "Disabled", save, reboot. Then go back and set to "Enabled".
  • Reset the TPM via motherboard jumper. On some desktops (Dell Optiplex, HP EliteDesk), there's a TPM reset jumper on the board. Unplug, move the jumper, wait 10 seconds, move it back. This is hardware-level – it clears the TPM regardless of OS.
  • Update TPM firmware. If you're on a Lenovo ThinkPad or Dell Latitude, the manufacturer sometimes releases a TPM firmware update. Check the vendor's support site. I've seen this fix the "bad context" error on TPM 1.2 chips after Windows 11 upgrades.
  • If BitLocker won't recover – boot from a recovery drive and run manage-bde -unlock C: -RecoveryPassword [your-48-digit-key]. If that fails, you may need to reinstall Windows. Always keep a backup of that key offline.

Prevention Tip

Before any BIOS update, suspend BitLocker temporarily. Run manage-bde -protectors -disable C: in Admin PowerShell. Re-enable it after the update with manage-bde -protectors -enable C:. This prevents the TPM from getting confused by the firmware changes. Also, avoid force-shutting down during encryption – let it finish.

If you're on Windows 11 22H2 or later, you might notice this error more often with AMD processors. Microsoft and AMD acknowledged a bug with TPM context handling in fTPM (firmware TPM). The fix is the same – clear and reinitialize. On Ryzen systems, you can also disable fTPM and switch to a discrete TPM module if the error keeps coming back.

Related Errors in Windows Errors
0XC00D1B7A NS_E_SOURCEGROUP_NOTPREPARED (0XC00D1B7A) Fix: Source Not Prepared 0X00000578 0X00000578: Invalid Window Handle Fix 0X80010134 CO_E_FAILEDTOGETWINDIR (0x80010134): Windows directory missing 0X00003616 IPsec IKE invalid cookie (0x00003616) fix for VPN connections

Was this solution helpful?

EP
Erropedia Team
Tech Support Editors
The Erropedia editorial team researches and documents real-world tech errors from across Windows, Linux, macOS, networking, databases, cloud platforms, and more. Every solution is reviewed for accuracy and updated as software and systems evolve.