Files, Storage and Formats

A Plain Guide to Digital Files, Folders and Formats

How computers turn documents, photos and music into stored data, what folders really are, and why so many different file formats exist.

On this page
  1. What a file actually is
  2. What folders are
  3. Why formats exist
  4. Why there are so many
  5. How the computer knows which program to use
  6. Compression and size
  7. Practical habits that follow from all this

What a file actually is

A file is a named block of stored data. Everything you keep on a computer, phone or memory card, from a photo to a spreadsheet to the program that opens them, is stored as files. The storage hardware itself knows nothing about photos or letters. It only holds a long sequence of numbers, and the file system on top of it keeps track of which stretch of storage belongs to which file.

At the lowest level those numbers are made of bits, each one a zero or a one. Eight bits make a byte, and a file is simply a particular number of bytes in a particular order. The idea behind this is binary code, though you do not need to know it to use files well.

Along with the content, the file system stores a little information about each file: its name, its size, when it was created and last changed, and where it sits in the folder structure. This is often called metadata. Some files also carry their own metadata inside them, such as the camera model and date inside a photo.

What folders are

A folder is a way of grouping files, and it is mostly a convenience for people. Folders can hold other folders, which gives the familiar tree shape: a top-level location, then branches, then individual files at the ends.

A file’s location is described by its path, the list of folders you pass through to reach it. Two files can have the same name as long as they sit in different folders, because the full path is what makes each one unique. Moving a file between folders on the same drive is usually quick, since typically only the record of where it lives changes, not the data itself. Copying it to another drive is slower, because the actual bytes have to be duplicated.

The way a drive stores all of this is called its file system. Common examples include NTFS on Windows, APFS on recent Apple devices, and exFAT or FAT32 on many memory cards and USB sticks. They differ in details such as the largest file they allow and which devices can read them, which is why a drive that works on one computer sometimes needs reformatting before another will use it.

Why formats exist

Because storage is just bytes, something has to decide what those bytes mean. A file format is an agreed set of rules for arranging information inside a file. A plain text file might store one number per character. A photo format stores the colour of each tiny dot, or a compact description from which the dots can be rebuilt. A music format stores sound samples.

Programs that follow the same rules can open each other’s files. That is the whole point of a format: it lets a file made in one program, or on one device, be read by another. Without agreed formats, every file would only open in the exact software that created it.

Formats generally exist in a few broad families:

  • Text and documents, such as plain text, word-processor files and PDFs.
  • Images, such as JPEG, PNG and WebP.
  • Audio and video, which usually combine a container with compressed streams inside.
  • Archives, such as zip files, which hold other files in one package.
  • Programs and system files, which the operating system runs rather than displays.

Why there are so many

Different jobs call for different trade-offs. A format that keeps every detail of a photograph will be large; a format that throws away detail the eye is unlikely to miss will be smaller. A format built for editing keeps layers and settings; a format built for sharing keeps only the finished result. New formats also appear when technology changes, for example to handle higher resolution or to play well in web browsers, and older ones stay around because people still have files in them.

Some formats are open, meaning their rules are published and anyone can write software for them. Others are proprietary, controlled by one company. Open formats are generally easier to read many years later, but plenty of proprietary ones are widely supported too.

How the computer knows which program to use

Most systems look at the end of the file name, such as .docx or .jpg, to decide which program should open it. That ending is the extension, and it is only a hint. Some programs also check the first few bytes of the file for a recognizable signature. Changing a file’s extension does not convert it; it only changes the label, which is why renaming a photo to end in .pdf does not make it a PDF.

Compression and size

Many formats shrink data to save space. Some do this without losing anything, so the original can be rebuilt exactly. Others discard detail permanently in exchange for much smaller files. Which kind a format uses has a real effect on quality, particularly if a file is edited and saved repeatedly.

Practical habits that follow from all this

Understanding the basics leads to some sensible habits:

  • Keep important documents in widely supported formats, so they are still readable in future.
  • Keep an original copy before converting a file to a smaller or lossier format.
  • Use clear names and a simple folder structure, because the computer will not do the organizing for you.
  • Remember that a file stored in one place only is at risk if that device fails. Keeping a copy somewhere else, such as cloud storage or an external drive, is a common safeguard, and outcomes depend on how reliably you keep it up to date.
  • When disk space runs short, look at what is large before deleting anything, so you do not remove things you still need.

Files are not magic. They are named stretches of bytes, grouped in folders, interpreted through formats, and handled by an operating system that keeps the records straight. Once that picture is clear, most everyday file problems, such as a document that will not open or a drive that will not mount, become easier to reason about.

Keep exploring

Guides from other topics

All topics →