A file is a container that holds information your computer can read and use

A file is a collection of data stored on your computer or device under a single name. Think of it like a document in a filing cabinet — it holds specific information (text, images, video, code, settings) and has a label so you can find it again. Your computer treats files as the basic unit of storage: everything you save, from a Word document to a photo to a video, is a file.

Files are organized into folders (also called directories), which work like drawers in that filing cabinet. A folder can hold multiple files or other folders inside it, creating a structure that helps you locate what you need. When you save something, you choose where to put it and what to name it — that name becomes the file's identifier on your system.

Every file has a file type, which tells your computer what kind of information it contains and which programs can open it. The file type is usually shown by the extension — the letters after the final dot in the filename. A .pdf file is a document, a .jpg is an image, a .mp3 is audio, and a .exe is a program. Without the correct file type, your computer may not know how to read the file or may open it in the wrong program.

Key Takeaways

  • A file is a named container of data stored on your device, and every file has a type that determines which programs can open it.
  • File extensions (the letters after the dot in a filename) show the file type — .pdf for documents, .jpg for images, .mp3 for audio, and so on.
  • Files are organized into folders, which can contain other folders, creating a structure that helps you find and manage your information.
  • Your operating system (Windows, macOS, or Linux) manages where files are physically stored on your hard drive and lets you move, copy, or delete them.

How file types work and why they matter

The file extension is a code that tells your computer and its programs what the file contains. When you double-click a .docx file, Windows or macOS looks at that extension and opens it with Microsoft Word (or another word processor). If you rename a .jpg file to .txt, your computer will try to open it as text, and you will see gibberish instead of an image — the file itself has not changed, but the system no longer knows what to do with it.

Some file types are proprietary, meaning they belong to a specific company or program. A .psd file is Adobe Photoshop's native format; a .xlsx file is Microsoft Excel's format. Other types are open standards that many programs can read — .pdf, .txt, .jpg, and .mp3 are examples. Open formats are often safer for long-term storage because you are not locked into one program.

Your computer can have multiple programs that open the same file type. You might have three different photo viewers installed, and Windows will have a default one it uses when you double-click a .jpg. You can change which program opens a file type by right-clicking the file, selecting "Open with," and choosing a different program, or by changing the default in your system settings.

Where files live on your computer

Files are stored on your hard drive (or solid-state drive), which is the physical storage inside your computer. The operating system — Windows, macOS, or Linux — manages a filing system that keeps track of where each file is located and how to retrieve it. You do not need to know the exact physical location; the operating system handles that behind the scenes.

On Windows, the main folder structure starts with the C: drive (usually your main hard drive). Inside that are system folders (where Windows itself lives) and user folders (where your personal files go). Your personal files typically live in C:\Users\[Your Name], with subfolders like Documents, Downloads, Pictures, and Desktop. On macOS, the structure is similar but uses a different naming convention, with your personal files in /Users/[Your Name].

When you save a file, you choose which folder to put it in. If you save a photo to your Desktop, it goes into the Desktop folder. If you save it to Documents, it goes there instead. The same file cannot exist in two places at once, but you can create a shortcut or alias that points to it from another location — the shortcut is a separate small file that links to the original.

File size and what it tells you

Every file has a size, measured in bytes. A kilobyte (KB) is 1,000 bytes, a megabyte (MB) is 1,000 kilobytes, and a gigabyte (GB) is 1,000 megabytes. A simple text document might be 50 KB. A high-resolution photo might be 5 MB. A movie file might be 2 GB. File size matters because it affects how much storage space your device has left and how long files take to upload or download.

You can see a file's size by right-clicking it and selecting Properties (Windows) or Get Info (macOS). If your hard drive is running low on space, checking file sizes helps you identify which files are taking up the most room. Large video or photo files are often the culprits. Deleting or moving files to external storage (like a USB drive or cloud service) frees up space on your main drive.

File size also affects sharing. If you try to email a 500 MB video file, most email services will reject it because it exceeds their size limit. In those cases, you would use a file-sharing service like Google Drive, Dropbox, or OneDrive instead, which can handle much larger files.

Common file types and what they do

Documents and text: .pdf (portable document format), .docx (Microsoft Word), .txt (plain text), .xlsx (Microsoft Excel spreadsheet). These hold written information, numbers, or data in a structured format. PDFs are read-only by default and look the same on any device, while .docx files can be edited.

Images: .jpg (compressed photo), .png (image with transparency), .gif (animated image), .bmp (uncompressed image). JPG is the most common for photos because it compresses the file to a smaller size. PNG is used when you need a transparent background. GIF is used for simple animations or memes.

Audio and video: .mp3 (compressed audio), .wav (uncompressed audio), .mp4 (compressed video), .mov (Apple video format), .avi (older video format). MP3 is the standard for music files. MP4 is the standard for video because it compresses the file while keeping good quality.

Programs and system files: .exe (Windows program), .app (macOS program), .dll (Windows library file), .sys (system file). These are executable files that run code. You should only download and run .exe or .app files from sources you trust, because they can contain malware.

How to manage files on your computer

Your operating system includes a file manager (File Explorer on Windows, Finder on macOS) that lets you view, move, copy, and delete files. You can create new folders to organize your files by project, date, or category. Most people keep a Documents folder for work files, a Pictures folder for photos, and a Downloads folder for files they have downloaded from the internet.

When you delete a file, it usually goes to the Recycle Bin (Windows) or Trash (macOS) first, where it stays until you empty the bin. This gives you a chance to recover it if you delete something by mistake. Once you empty the bin, the file is harder to recover, though specialized recovery software may still find it.

You can also compress files to make them smaller. On Windows, right-click a file or folder and select "Send to" then "Compressed (zipped) folder." On macOS, right-click and select "Compress." This creates a .zip file that takes up less space and is easier to email or upload. The recipient can unzip it to get the original files back.

Files in the cloud and on external devices

You do not have to store all your files on your computer's hard drive. Cloud storage services like Google Drive, OneDrive, and Dropbox let you save files to the internet instead. The files are stored on the company's servers, and you can access them from any device with an internet connection. Cloud storage also acts as a backup — if your computer breaks, your files are still safe online.

External storage devices like USB drives and external hard drives let you move files off your computer to free up space. You can plug a USB drive into your computer, drag files onto it, and then unplug it to carry those files somewhere else or store them safely. External hard drives work the same way but hold much more data — often 1 TB or more, compared to a USB drive's typical 32 GB to 256 GB.

When you move a file to cloud storage or an external device, it no longer takes up space on your computer's main drive. If you delete it from the cloud or external device, it is gone from there, but you still have it on your computer (unless you deleted it there too). Many people use a combination of local storage, external drives, and cloud storage to keep their files organized and backed up.

Frequently Asked Questions

What happens if I change a file's extension?

Changing the extension does not change what the file actually contains — it only changes how your computer tries to read it. If you rename a .jpg to .txt, the image data is still there, but your computer will try to open it as text and show you gibberish. You can rename it back to .jpg and it will work again. However, some programs may refuse to open a file if the extension does not match the actual content.

Can I have two files with the same name in the same folder?

No. Your computer requires each file in a folder to have a unique name. If you try to save a file with a name that already exists in that folder, the system will ask if you want to replace the old file or save with a different name. You can have files with the same name in different folders — for example, a file called "Budget.xlsx" in your Documents folder and another "Budget.xlsx" in your Desktop folder.

Why do some files open in the wrong program?

Your computer has a default program set for each file type. If a .pdf opens in Notepad instead of Adobe Reader, it means Notepad is set as the default for PDFs. You can change this by right-clicking the file, selecting "Open with," choosing the program you want, and checking a box to make it the default. On Windows, you can also change defaults in Settings under "Apps" and "Default apps."

Is it safe to download files from the internet?

Downloading files is generally safe, but you should only download from sources you trust. Avoid downloading .exe or .app files from unfamiliar websites, because they could contain malware. Files from reputable companies, official websites, and well-known services like GitHub are usually safe. Your antivirus software can scan downloaded files for threats before you open them.

What is the difference between moving and copying a file?

Copying creates a duplicate of the file in a new location — the original stays where it was, and you now have two copies. Moving removes the file from its original location and puts it in the new one — you end up with only one copy. On most computers, you copy by right-clicking and selecting "Copy," then right-clicking in the new location and selecting "Paste." You move by dragging and dropping, or by cutting and pasting.