A file is a container your computer uses to store one piece of information
A file is a block of data saved on your computer's hard drive or storage device. It holds one thing — a document, a photo, a video, a program, or a piece of music. Your computer treats it as a single unit with a name, a location, and a type. When you save something, you are creating a file. When you open something, you are reading a file.
Every file has three parts you need to know: a name, a location, and a file type. The name is what you call it — "Resume" or "Vacation Photos". The location is where it lives on your computer — usually in a folder like Documents or Downloads. The file type tells your computer what program should open it, and you can see it in the file extension — the letters after the dot at the end of the name.
Files are the reason your computer can do anything useful. Without files, there would be nowhere to store your work, your photos, or your programs. Everything you create, download, or install becomes a file or a collection of files.
Key Takeaways
- A file is a single unit of stored information with a name, location, and type that your computer recognizes.
- The file extension — the letters after the dot in the filename — tells your computer which program should open it.
- Files live in folders, which are containers that organize files into groups so you can find them later.
- Your computer stores files on a hard drive or solid-state drive, and you can copy, move, rename, or delete them.
How file extensions work
The file extension is the short code at the end of a filename that identifies what kind of file it is. In the filename "MyPhoto.jpg", the extension is "jpg". In "Budget.xlsx", it is "xlsx". Your computer reads this extension and decides which program to use when you double-click the file.
Common extensions include .txt for text documents, .pdf for formatted documents, .jpg and .png for images, .mp3 for music, .mp4 for video, and .exe for programs on Windows. On a Mac, programs often end in .app. If you try to open a file with the wrong program, it will not work — a photo viewer cannot open a spreadsheet, and a text editor cannot play a video.
You can change a filename, but changing the extension can break the file. If you rename "Photo.jpg" to "Photo.txt", your computer will still think it is a text file, and it will not open correctly in a photo viewer. Some files hide their extensions by default, but you can turn that setting on in your file manager to see them clearly.
Where files live on your computer
Files are organized in folders, which are containers that hold files and other folders. Your computer comes with a main folder called the home directory or user folder, and inside it are standard folders like Documents, Downloads, Desktop, and Pictures. When you save a file, you choose which folder to put it in.
Folders can contain other folders, creating a tree structure. You might have a folder called "2024 Taxes" inside your Documents folder, and inside that a folder called "Receipts". This nesting helps you find files later. The path to a file shows every folder it is inside — on Windows it might look like C:\Users\YourName\Documents\2024 Taxes\Receipts\Receipt.pdf.
The Desktop is a special folder that appears as the background of your screen. Files and folders you put there show up as icons. The Downloads folder is where files from the internet land by default. Keeping files organized in the right folders makes them much easier to find when you need them.
How your computer stores files
Files are stored on a hard drive or solid-state drive — the physical device inside your computer that holds all your data permanently. When you save a file, your computer writes the data to this drive. When you turn off your computer, the files stay there. When you turn it back on, they are still there.
Your computer's memory (RAM) is different from storage. Memory is fast but temporary — it holds information while your computer is running, but it disappears when you shut down. Storage is slower but permanent. Files live in storage. Programs run in memory. This is why you can close a program without losing the file you were working on — the file is in storage, safe.
The amount of storage your computer has is measured in gigabytes (GB) or terabytes (TB). A typical laptop might have 256 GB or 512 GB. A large video file might be 4 GB. A photo might be 5 MB. When your storage fills up, your computer slows down, and you may not be able to save new files. You can delete old files to free up space, or move them to an external drive.
What you can do with files
Once a file exists, you can perform several actions on it. You can open it by double-clicking, which tells your computer to read it and display it in the correct program. You can copy it, which creates an identical file in another location while keeping the original. You can move it, which removes it from one folder and puts it in another. You can rename it, which changes its name but not its contents.
You can also delete a file, which removes it from your computer. On most systems, deleted files go to a Trash or Recycle Bin folder first, where they stay until you empty the bin. This gives you a chance to recover a file if you delete it by mistake. Once you empty the bin, the file is gone for good.
You can share a file by sending it to someone else via email or a file-sharing service. You can compress it, which makes it smaller so it is faster to send or takes up less space. You can also back up a file by copying it to an external drive or cloud storage, so you have a copy if something happens to the original.
File types and what programs open them
Different file types are designed for different purposes, and each type usually has a program that knows how to open it. Document files like .docx (Microsoft Word) and .odt (OpenOffice) contain text and formatting. Spreadsheet files like .xlsx (Excel) contain numbers and formulas. Image files like .jpg, .png, and .gif contain pictures. Video files like .mp4 and .mov contain moving images and sound.
Some file types are proprietary, meaning they belong to a specific company and work best with that company's program. A .docx file is Microsoft's format and opens best in Microsoft Word. Other formats are open, meaning anyone can create a program to open them. A .txt file is plain text and opens in any text editor.
If you do not have the right program installed, you can often download one for free. Many file types have multiple programs that can open them. A .jpg image can open in Windows Photos, Preview on Mac, or dozens of other programs. Choosing which program to use is usually up to you.
Frequently Asked Questions
What is the difference between a file and a folder?
A file is a single unit of stored information — a document, photo, or program. A folder is a container that holds files and other folders. Think of a file as a piece of paper and a folder as a filing cabinet drawer that holds many pieces of paper.
Can I change a file's extension to convert it to a different type?
Changing the extension does not convert the file. It only tells your computer which program to use when opening it. If you rename "Photo.jpg" to "Photo.mp3", your computer will try to open it as music, but it will fail because the file is still actually a photo. To truly convert a file, you need a program designed to do that conversion.
What happens if I delete a file by accident?
On Windows and Mac, deleted files go to the Recycle Bin or Trash folder first. You can open that folder and restore the file to its original location. Once you empty the bin or trash, the file is permanently deleted and cannot be recovered unless you have a backup copy.
Why do some files have names I cannot understand?
System files and program files often have names that look like random letters and numbers. These are created by programs and are not meant to be read by humans. You should not rename or delete them unless you know exactly what you are doing, because they may be necessary for your computer to work properly.
Can I store files on the internet instead of my computer?
Yes. Cloud storage services like Google Drive, OneDrive, and Dropbox let you save files on their servers instead of your hard drive. You can access these files from any computer with internet. This also creates a backup in case your computer fails, but you need internet to reach your files.