Depends on the version but product keys are not always necessary. You just need a boot disk (or thumb drive) ..
https://answers.microsoft.com/en-us/windows/forum/all/have-to-replace-hard-drive-will-i-need-the-product/0b2fa02e-905c-4bdf-8096-6498b473754e