Windows stopped suddenly, showed Your PC ran into a problem and needs to restart or Your device ran into a problem and needs to restart, and restarted. This is a stop code error, widely known as a blue screen. Windows stops on purpose when a driver, a piece of hardware or a damaged file could harm your files if it kept going. A single one, once, is usually nothing to act on: in most cases the restart clears it.

First, find the stop code

The stop code is the word in capitals near the bottom of the screen, such as MEMORY_MANAGEMENT. It tells you what kind of problem Windows hit. If it happens again, take a photo of the screen with your phone. If the PC restarted before you could read it, Windows keeps a record in Reliability Monitor.

  1. Press Windows logo key + R, type the command below and select OK.
    Type this in Run box
    perfmon /rel
    How do I open Run box?

    Press the Windows logo key and R together, type the text into the Open box and select OK.

  2. In the chart, select the day the PC crashed. A red circle with a white cross marks a serious event.
  3. In the list below the chart, find an entry from Windows such as Shut down unexpectedly, and double-click it to see the technical details.
  4. Find the line labelled Code. It shows the stop code in short form: ef is 0x000000EF, a is 0x0000000A, 133 is 0x00000133 and 1a is 0x0000001A.

Paste the code into our report reader for a plain-English explanation, or look it up in the error code list. These common codes have their own pages:

If the blue screen appears every time the PC starts, so you can't reach the desktop, read Stuck in an Automatic Repair loop first. The fixes below can also be done from Safe Mode.

Fix 1: Undo recent changes

10 to 20 minutesChanges settings

Most stop codes are caused by a driver or a piece of hardware. If the crashes began after you added a device, installed an app or updated a driver, undoing that change is the quickest test.

  1. Shut down the PC and unplug any hardware you added recently, such as a new drive, memory or USB device. Start the PC and use it as normal for a while.
  2. If you installed an app or driver shortly before the crashes began, uninstall it:

    Windows 11

    Settings, then Apps, then Installed apps, then select … beside it and choose Uninstall.

    Windows 10

    Settings, then Apps, then Apps & features, then select it and choose Uninstall.
  3. Restart the PC.

Did that fix it?

No, try fix 2

Fix 2: Install Windows updates

15 to 60 minutesChanges settings

Microsoft and PC makers publish fixes for known crashes through Windows Update, including updated drivers. Bringing Windows up to date often stops a crash that other people have already hit.

  1. Open Windows Update:

    Windows 11

    Settings, then Windows Update

    Windows 10

    Settings, then Update & Security, then Windows Update
  2. Select Check for updates and install everything offered.
  3. Look for driver updates too:

    Windows 11

    go to Settings, then Windows Update, then Advanced options, then Optional updates, open Driver updates, tick them and select Download & install.

    Windows 10

    select View optional updates on the Windows Update page, open Driver updates, tick them and select Download & install.
  4. Restart the PC, even if Windows doesn't ask you to.

Did that fix it?

No, try fix 3

Fix 3: Roll back or update drivers

15 to 30 minutesChanges settings

A driver is the small program that runs a piece of hardware, and faulty drivers cause most stop codes. If the crashes began after a driver update, going back helps. If a driver is old, a newer one from your PC maker can help.

  1. Right-click Start and select Device Manager.
  2. Look for any device with a yellow warning mark. Expand each group to check.
  3. If the crashes began after a driver update, right-click that device, select Properties, open the Driver tab and select Roll Back Driver. If it is greyed out, there is no earlier driver to go back to.
  4. To get a newer driver, go to your PC maker's support site, find your model and install its latest drivers, especially for graphics, chipset, storage and network. Never use a "driver download" site.
  5. Restart the PC.

Some stop screens also show a What failed line with a file name ending in .sys. That is the driver that was running, and it is a strong clue to which device to look at.

Did that fix it?

No, try fix 4

Fix 4: Repair system files with DISM and SFC

20 to 40 minutesChanges settings

Damaged Windows system files can cause crashes. DISM repairs the store of files Windows keeps for repairs, then SFC uses it to check and replace damaged system files. Your personal files are not touched.

  1. Open Command Prompt as administrator.
  2. Type each command and press Enter. Wait for the first to finish before typing the second.
    Type this in Command Prompt, as administrator
    DISM.exe /Online /Cleanup-image /Restorehealth
    sfc /scannow
    How do I open Command Prompt as administrator?

    Select Start and type cmd. Right-click Command Prompt in the results and choose Run as administrator. Select Yes if Windows asks for permission.

  3. Restart the PC when both have finished.

Did that fix it?

No, try fix 5

Fix 5: Test the memory with Windows Memory Diagnostic

20 to 60 minutesSafe

Faulty memory (RAM) causes crashes with many different stop codes, which is one sign to look for. Windows has a built-in memory test that runs while Windows is not loaded.

  1. Save your work and close your apps.
  2. Press Windows logo key + R, type the command below and select OK.
    Type this in Run box
    mdsched.exe
  3. Select Restart now and check for problems (recommended). The test runs by itself after the restart.
  4. When Windows starts again and you sign in, a notification shows the result.

If the test reports memory errors, the memory needs checking by a repair shop or your PC maker. MEMORY_MANAGEMENT explains what's involved.

Did that fix it?

No, try fix 6

Fix 6: Check the drive

10 to 30 minutesChanges settings

Errors on the drive can damage the files Windows needs while it runs. The check below looks at the drive's file system without a restart. A nearly full drive can also cause trouble: Microsoft suggests keeping roughly 10 to 15% free.

  1. Open Command Prompt as administrator, type this command and press Enter:
    Type this in Command Prompt, as administrator
    chkdsk C: /scan
  2. If it reports that the drive has no problems, move on. If it says problems need fixing, type chkdsk C: /f and press Enter. When asked whether to check the drive the next time the system restarts, type Y and press Enter, then restart.
  3. Check the free space in Settings, then System, then Storage. If the drive is nearly full, read Free up disk space.

Did that fix it?

No, try fix 7

Fix 7: Use System Restore

20 to 40 minutesChanges settings

System Restore takes Windows' system files, drivers, settings and apps back to a restore point from before the crashes began. Your documents and photos are not changed.

  1. Press Windows logo key + R, type the command below and select OK.
    Type this in Run box
    rstrui.exe
  2. Select Next and choose a restore point from before the first crash.
  3. Select Scan for affected programs to see what will be removed, then Close.
  4. Select Next, then Finish. The PC restarts when it is done.

See Use System Restore for more detail.

Did that fix it?

When it's probably hardware

If the stop code changes each time, the memory test reports errors, or the drive check can't finish, a part inside the PC is the likely cause. Many PCs have a hardware test built in, and your PC maker's support site explains how to start it. If the PC is under warranty, go to the PC maker first. Otherwise a local repair shop can test the memory, drive and power supply.