Applies ToSecurity Windows 7 Windows 8.1 Windows 10

Ransomware is malware that encrypts your files or stops you from using your computer until you pay money (a ransom) for them to be unlocked. If your computer is connected to a network the ransomware may also spread to other computers or storage devices on the network. 

Some of the ways you can get infected by ransomware include:

  • Visiting unsafe, suspicious, or fake websites.

  • Opening file attachments that you weren’t expecting or from people you don’t know.

  • Opening malicious or bad links in emails, Facebook, Twitter, and other social media posts, or in instant messenger or SMS chats.

You can often recognize a fake email and webpage because they have bad spelling, or just look unusual. Look out for strange spellings of company names (like "PayePal" instead of "PayPal") or unusual spaces, symbols, or punctuation (like "iTunesCustomer Service" instead of "iTunes Customer Service").

Ransomware can target any PC—whether it’s a home computer, PCs on an enterprise network, or servers used by a government agency.

Caution: Mobile devices can get ransomware too! Learn how to protect your devices

Your browser does not support video. Install Microsoft Silverlight, Adobe Flash Player, or Internet Explorer 9.

How can I help keep my PC secure?

  • Make sure your PC is up to date with the latest version of Windows and all the latest patches. Learn more about Windows Update.

  • Be sure Windows Security is turned on to help protect you from viruses and malware (or Windows Defender Security Center in previous versions of Windows 10).

  • In Windows 10 or 11 turn on Controlled Folder Access to protect your important local folders from unauthorized programs like ransomware or other malware.

  • Get ransomware detection and recovery with Microsoft 365 advanced protection.

  • Store important files on Microsoft OneDrive. OneDrive includes built in ransomware detection and recovery as well as file versioning so you can restore a previous version of a file. And when you edit Microsoft Office files stored on OneDrive your work is automatically saved as you go.

  • Use a secure, modern, browser such as Microsoft Edge.

  • Restart your computer periodically; at least once a week. This can help ensure the applications and operating system are up-to-date and helps your system run better.

Note: If you're a small business owner consider using Microsoft 365 Business Premium. It includes Microsoft Defender Advanced Threat Protection to help protect your business against online threats.Learn more about Microsoft 365 Business Premium Security

If you suspect you’ve been infected

Use antimalware programs, such as Windows Security, whenever you’re concerned your PC might be infected. For example, if you hear about new malware in the news or you notice odd behavior on your PC. See Virus & threat protection in Windows Security for how to scan your device.

If you actually get a ransomware infection

Unfortunately, a ransomware infection usually doesn’t show itself until you see some type of notification, either in a window, an app, or a full-screen message, demanding money to regain access to your PC or files. These messages often display after encrypting your files.

Try fully cleaning your PC with Windows Security. You should do this before you try to recover your files. Also see Back up your Windows PC for help on backing up and recovering files for your version of Windows.

Don't pay money to recover your files. Even if you were to pay the ransom, there is no guarantee that you'll regain access to your PC or files.

What to do if you already paid

If you’ve already paid the ransom, immediately contact your bank and your local authorities. If you paid with a credit card, your bank may be able to block the transaction and return your money.

You can also contact the following government fraud and scam reporting websites:

If your region isn't listed here, Microsoft recommends that you contact your region's federal police or communications authority.

For an illustrated overview about ransomware and what you can do to help protect yourself, see The 5Ws and 1H of ransomware. 

If you're in an enterprise, see the Microsoft Malware Protection Center for in-depth information about ransomware

See also

How malware can infect your PC

Protect yourself from online scams and attacks

Back up your Windows PC

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.