Every file is basically a string of zeros and ones. A file format is the rule that says how those zeros and ones should be turned into text, an image, sound or video. The extension (the part after the dot) is a marker for identifying the format.
Common examples#
- Text: txt, docx, pdf.
- Images: jpg, png, webp, svg.
- Audio: mp3, wav, flac.
- Video: mp4, mkv.
- Compressed: zip, rar, 7z.
- Data: csv, json.
An example#
A jpg photo has a small size, but its quality drops a little each time you save it. png has no quality loss and suits logos and transparent images. webp is usually smaller at similar quality and is good for websites.
Why does it matter?#
- To send an email or upload to a site or messenger, you need to know the allowed format and an acceptable size.
- It affects site speed and file size.
- Some formats (such as exe or scripts) are dangerous.
A note#
Changing the extension by renaming does not change the real format. If you change an mp3 extension to jpg, the file does not become a picture. For that you need a format conversion tool.