Skip to content
Open File Box
  • File Formats
  • Recovering Files
  • Storage and Drives
  • Backup Basics
  • Cloud Storage
  • Archives and Compression
  1. Home
  2. Safe Downloads
  3. File Extensions That Can Run Code: What to Know
Safe Downloads

File Extensions That Can Run Code: What to Know

Understand which file extensions are just data and which can run programs, so you know when double-clicking deserves caution.

Tobias LindqvistNovember 7, 20263 min read

Every file name ends with a short tag, called an extension, that tells your computer how to treat it. A .jpg is a picture, a .txt is text, and a .pdf is a document. But some extensions tell your computer to run instructions instead of simply showing content. Knowing the difference is one of the simplest ways to avoid trouble.

What an extension does

The extension is a label that associates the file with a program. When you double-click a photo, your computer opens an image viewer. When you double-click a program file, the computer runs it. That second case is where danger lies, because a harmful program can do things such as delete files, steal information or install other software.

Extensions that usually run programs

On Windows, common executable and script types include .exe, .msi, .bat, .cmd, .com, .scr, .ps1, .vbs and .js. On macOS, installers and apps such as .app, .pkg and .dmg can run or install software, and shell scripts can too. Java programs use .jar, and some systems run shortcuts or link files that point to other commands. You do not need to memorize the list. Remember the idea: if the file is a program or a script, it can act on your computer.

Extensions that are usually data

Images such as .jpg and .png, audio such as .mp3, plain text and most videos are normally treated as content to display or play. They are generally safer, though not completely risk-free, since software that opens them can sometimes contain bugs. Keeping your software updated reduces that risk.

Documents that can carry risks

Office documents and spreadsheets can include macros, small programs inside the document. If you open a file and it asks you to enable macros or editing to see the content, be careful. Unless you know exactly why a macro is needed and trust the sender, leave it disabled. PDFs are normally safe, but outdated readers have had security problems, so keep them updated.

Archives and disk images

Archives such as .zip, .7z and .rar are containers. They are not harmful in themselves, but what is inside might be. Disk images such as .iso and .dmg also hold files, which may include installers. Look inside before running anything.

Double extensions and hidden names

Attackers often disguise programs with names like holiday-photo.jpg.exe. If your computer hides extensions, you may see only holiday-photo.jpg. Turn on the option to show extensions so you can read the full name. A file that claims to be a picture but ends in .exe is a clear red flag. Icons can be faked as well, so do not rely on them alone.

You might also like

When a File Extension Does Not Match

Build a simple habit

Before opening a file, ask three questions:

  1. Do I know where this file came from?
  2. Does the extension match what I expect?
  3. Could this file run code, and do I want that?

A full routine is laid out in how to check a download before you open it, and the tricks used on download pages are covered in spotting fake download buttons and bundled installers.

Let your system help

Keep your operating system's built-in protections turned on. Many systems display a warning for files from the internet and may block unknown programs by default. Do not turn these off to save a click.

If you opened something by mistake

Disconnect from the network, run a full scan, change important passwords from another device and check for unfamiliar programs. If you are unsure what to do, ask a trusted technician.

Frequently asked questions

Can a .txt file be dangerous? A plain text file itself does not run, but a file renamed to look like text might not be one. Always check the full name and type.

Are all .exe files bad? No. They are the normal way to install many programs. The key is whether you trust the source.

Do phones have the same issue? The types differ, but the principle holds. Install apps only from official stores and be cautious with files from unknown senders.

Tags

  • file extensions
  • executable files
  • scripts
  • malware awareness
  • safe computing
T
Tobias Lindqvist

Tobias Lindqvist writes about file formats, backups, archives and digital organization. He is interested in dependable habits, such as clear folder structures and tested backups, and enjoys explaining storage ideas in everyday language. His articles aim to help readers protect their files without needing specialist skills.

Previous post

A Monthly Digital Clean-Up Routine in 30 MinutesNovember 7, 2026

Next post

A Simple Backup Plan for a Small OfficeNovember 7, 2026

Contents

  • What an extension does
  • Extensions that usually run programs
  • Extensions that are usually data
  • Documents that can carry risks
  • Archives and disk images
  • Double extensions and hidden names
  • Build a simple habit
  • Let your system help
  • If you opened something by mistake
  • Frequently asked questions

Related posts

  • Questions to Ask Before a Template Download
  • Temporary Files Left Behind After an Install
  • Why Free Converter Sites Are a Risky Shortcut
  • A Checklist for Files That Arrive by Email
  • Read the Whole File Name, Not the Icon

Categories

  • File Formats
  • Recovering Files
  • Storage and Drives
  • Backup Basics
  • Cloud Storage
  • Archives and Compression
  • File Organization
  • Safe Downloads

Open File Box

Plain-English guides to file formats, backups, archives and keeping your digital files organized and safe.

Categories

  • File Formats
  • Recovering Files
  • Storage and Drives
  • Backup Basics
  • Cloud Storage
  • Archives and Compression
  • File Organization
  • Safe Downloads

About

  • About Open File Box
  • Contact Open File Box
  • Privacy Policy
  • Sitemap
  • XML sitemap
  • RSS
hacklink satın al grandpashabet giriş grandpashabet grandpashabet grandpashabet jojobet giriş jojobet jojobet güncel giriş jojobet giriş jojobet jojobet giriş jojobet giriş jojobet jojobet giriş jojobet giriş jojobet jojobet jojobet jojobet giriş jojobet giriş jojobet güncel giriş jojobet jojobet jojobet jojobet giriş jojobet güncel giriş jojobet jojobet giriş jojobet güncel giriş jojobet jojobet giriş jojobet güncel giriş marsbahis marsbahis giriş marsbahis güncel giriş kavbet kavbet vaycasino gamdom grandpashabet grandpashabet giriş grandpashabet güncel giriş grandpashabet grandpashabet giriş grandpashabet güncel giriş grandpashabet grandpashabet giriş grandpashabet güncel giriş grandpashabet

© 2026 Open File Box. All rights reserved.