A DLL file is a library of code that programs share instead of each keeping their own copy

DLL stands for Dynamic Link Library. It is a file that contains code and data that multiple programs can use at the same time. Instead of every program on your computer writing its own code to do common tasks — like displaying a button on screen or saving a file — they can all call the same DLL file to do that work. This saves disk space and makes updates easier, because fixing a bug in one DLL fixes it for every program that uses it.

DLL files are Windows-specific. On Mac computers, the equivalent is called a framework or dylib. On Linux, they are called shared objects. But the idea is the same: one file, many programs using it.

You will not normally interact with DLL files directly. They sit in system folders, and programs load them automatically when they start. But understanding what they are helps you understand error messages, troubleshoot problems, and know when it is safe to delete a file.

Key Takeaways

  • A DLL file contains shared code that multiple programs use, rather than each program storing its own copy of the same code.
  • DLL files live in system folders like System32 or in the folder where a program is installed, and load automatically when a program starts.
  • A missing or corrupted DLL file causes an error message naming the DLL, and the fix depends on whether the DLL belongs to Windows or to a specific program.
  • You should not delete a DLL file unless you are certain no program on your computer needs it, because doing so can break multiple programs at once.

Where DLL files live on your computer

DLL files are stored in specific folders depending on what they do. System DLLs — the ones Windows itself needs — live in C:\Windows\System32 on most computers. You can navigate there by opening File Explorer, typing that path in the address bar, and pressing Enter. You will see hundreds of DLL files with names like kernel32.dll, user32.dll, and gdi32.dll. These are core Windows files that almost every program uses.

Program-specific DLLs live in the folder where the program is installed. If you install Microsoft Office, for example, some of its DLL files go in C:\Program Files\Microsoft Office. If you install a game, its DLL files go in the game's folder. When you uninstall a program, its DLL files are supposed to be removed too — though sometimes they are left behind.

Your user account folder can also contain DLL files, usually in hidden subfolders like AppData. These are often temporary or program-specific files that do not affect other programs.

What happens when a DLL file is missing or broken

When a program tries to load a DLL file that is not there, or the file is corrupted, you get an error message. The message usually names the DLL: something like "The program can't start because msvcp140.dll is missing from your computer" or "Error loading mscoree.dll". The name tells you which library is broken.

If the missing DLL is a system file like kernel32.dll, Windows itself may not start properly, or you may see errors on startup. If it is a program-specific DLL, only that program will fail to open. If multiple programs use the same DLL — which is common for Microsoft Visual C++ libraries or DirectX files — multiple programs may break at once.

The fix depends on what the DLL does. For system DLLs, you may need to repair Windows using the built-in recovery tools. For program DLLs, reinstalling the program usually restores the missing file. For shared libraries like Visual C++ Runtime, you can download and install the library directly from Microsoft.

Why programs share DLL files instead of keeping their own copy

Sharing code through DLL files saves space and makes maintenance easier. Imagine if every program on your computer had its own copy of the code needed to display windows, save files, and handle network connections. Your hard drive would fill up much faster, and if a security bug was found in that shared code, Microsoft would have to fix it in hundreds of separate files instead of one.

By using DLL files, Microsoft can fix a bug once and every program that uses that DLL automatically gets the fix the next time it loads. This is why Windows updates sometimes update DLL files — they are patching code that many programs depend on.

The downside is that if a DLL file breaks, it can break multiple programs at once. This is why DLL errors are sometimes frustrating: one corrupted file can affect several unrelated programs.

When it is safe to delete a DLL file

You should almost never delete a DLL file manually. The only safe time is when you are uninstalling a program and its DLL files are left behind. Even then, you need to be certain that no other program on your computer uses that DLL.

A DLL file name often tells you what it does. A file named "msvcp140.dll" is a Microsoft Visual C++ library used by many programs. A file named "d3d11.dll" is part of DirectX, used by games and graphics software. If you delete a shared library like these, you may break programs that have nothing to do with the program you were uninstalling.

The safest approach is to use the Windows uninstaller to remove programs. Go to Settings > Apps > Apps & Features, find the program, and click Uninstall. This removes the program and its DLL files safely. If you find a DLL file you think is orphaned — left over from a program you already uninstalled — you can search for its name online to see what it does before deciding whether to delete it.

DLL files and security

DLL files can be a security risk if they are modified by malware. A virus or trojan can replace a legitimate DLL file with a malicious version, and then every program that loads that DLL will run the malicious code. This is called DLL injection, and it is a common attack method.

Windows Defender and other antivirus programs scan DLL files for known malware. If you see an antivirus alert about a DLL file, take it seriously — do not ignore it or whitelist it unless you are certain it is legitimate. If you downloaded a program from an untrusted source and now you are seeing DLL errors or antivirus warnings, uninstall the program and run a full antivirus scan.

You can also check whether a DLL file is legitimate by right-clicking it, selecting Properties, and looking at the Details tab. A real Windows DLL will show a company name like Microsoft Corporation. If the company name is blank or suspicious, the file may be malware.

How to find out what a DLL file does

If you see a DLL file name in an error message or you are wondering what a file does, you can search for it online. Most common DLL files have documentation or forum posts explaining what they are. A search for "kernel32.dll" or "msvcp140.dll" will quickly tell you what the file does and which programs use it.

You can also right-click a DLL file and select Properties. The Details tab shows the file description, version number, and company name. This information often tells you what the file does and whether it is part of Windows or a specific program.

If you are trying to fix a DLL error, the error message itself is usually your best clue. It names the DLL, and you can search for that name plus the word "error" to find solutions. Most common DLL errors have known fixes — usually reinstalling a program, updating Windows, or installing a missing library.

Frequently Asked Questions

Can I move a DLL file to a different folder?

No. Programs look for DLL files in specific locations. If you move a DLL file, the program that needs it will not find it and will crash. The only exception is if you are moving a program to a new computer — in that case, move the entire program folder, which keeps the DLL files in the right place relative to the program.

What does it mean when I see "DLL not found" error?

It means a program tried to load a DLL file and could not find it. The error message usually names the DLL. The fix depends on the DLL: reinstall the program if it is program-specific, repair Windows if it is a system file, or download the missing library from Microsoft if it is a shared runtime like Visual C++.

Is it safe to download DLL files from the internet?

No. Downloading DLL files from random websites is risky because malware often disguises itself as a DLL file. If you need a missing DLL, download it from the official source: Microsoft for Windows and Visual C++ libraries, or the program's official website for program-specific DLLs.

Why do some programs come with their own DLL files?

Some programs include their own DLL files to make sure they have the exact version they need. This avoids conflicts with other programs that might need a different version of the same DLL. It uses more disk space but makes the program more reliable.