Nepedia
Back to Discover
Fluent Reader
💻

File format

technology Maturity 11-13 Next article →

A computer file is not just a pile of data. It needs a specific way to be organized so the computer can understand it. This way of organizing information is called a file format.

Some formats are very simple and only hold one type of thing. For example, a PNG file is used to store bitmapped images. Other formats work like a container. The Ogg format can hold many different types of data at once. It can hold audio, video, and even text like subtitles.

This makes it very useful for multimedia.

To make these files work, there must be a set of rules. These rules are often found in a document called a specification. This document explains exactly how the data should look. Not every format has a public specification. Some companies keep their rules a secret to protect their ideas. Other times, a developer has to use reverse engineering to figure it out. They do this by carefully inspecting the files to see how they work. This can take a lot of time and money. Because of this, formats with public rules are usually supported by more programs.

Sometimes, the rules for a format are protected by law. This is often done using patent law. A patent can protect a special way that a file shrinks data, which is called an algorithm. For example, the GIF format used a patented algorithm for a long time. Before 2004, people had to pay royalty fees to use it. This caused many people to stop using GIFs. Instead, they started using the PNG format. The GIF patent eventually expired in the US in mid-2003. It expired worldwide in mid-2004.

How does a computer know which format to use? One common way is by looking at the file extension. This is a short suffix at the end of a filename. For instance, an HTML file ends with .html. A GIF image ends with .gif. Many systems like Windows and macOS use this method. In the old FAT file system, names were very short. They used an 8.3 naming scheme with only eight characters for the name. Today, we use longer extensions, but many still use three letters. This can sometimes confuse people or computers if two formats use the same short label.

Computers can also look inside the file to find its identity. They might look for a file header at the very beginning. This header contains metadata, which is extra information about the file. It might tell the computer the size or the color of an image. Some files even have a magic number. This is a small piece of data that uniquely identifies the format. For example, a GIF file always starts with specific letters. This helps the computer check if the file is correct or broken.

470 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (2)
Bass loop 1 (Carrai Pass).wav
Boogie riff 1.ogg
More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.