Why file formats matter

A file format describes how information is arranged inside a file.

Illustration for the article: Why file formats matter

Updated:

A file format describes how information is arranged inside a file. Two files can hold the same photo, document or recording and still behave very differently: one opens everywhere, another only in a single program; one keeps every detail, another throws detail away to save space; one will still be readable in twenty years, another depends on a company that may not exist by then. Knowing what a format promises makes it easier to choose the right one and to avoid losing work.

What is inside a file format

A file is a sequence of bytes. On its own, that sequence means nothing; the format is the agreement about how to interpret it. Most formats begin with a short signature (the “magic number”) that identifies the type, followed by a header describing dimensions, encoding, compression and metadata, followed by the payload itself. The extension at the end of the file name, such as .jpg or .docx, is only a hint for the operating system. Renaming a file does not convert it; the bytes stay the same and a program that trusts the extension will simply fail to open it.

Formats differ along a few important axes:

  • Open or proprietary. An open format has a public specification anyone can implement, such as PNG, PDF, FLAC or the OpenDocument family. A proprietary format is controlled by one vendor; other programs support it through reverse engineering and may get details wrong.
  • Lossless or lossy. Lossless formats (PNG, FLAC, ZIP) reproduce the original exactly. Lossy formats (JPEG, MP3, most video codecs) discard information that people are unlikely to notice in exchange for much smaller files. Each re-save of a lossy file discards a little more.
  • Container or codec. Video files illustrate a common confusion. An .mp4 or .mkv file is a container that can hold audio and video streams encoded with different codecs. A player may open the container but fail on the codec inside.
  • Text or binary. Plain-text formats such as CSV, JSON, Markdown and SVG can be read and repaired with any editor. Binary formats are more compact but opaque without the right software.

Everyday examples

Photos. A phone camera stores JPEG or HEIC by default. HEIC files are roughly half the size for the same quality, but older Windows machines and some web services do not accept them, which is why people find their pictures “won’t open” after transferring them. For editing, photographers keep RAW files, which preserve sensor data at the cost of size and compatibility.

Documents. A .docx file from one word processor usually opens in another, but layout, fonts and tracked changes may shift. When the goal is for the reader to see exactly what you saw, PDF is the safer choice because it fixes layout rather than describing content to be laid out.

Data. Spreadsheets exported as CSV lose formulas, formatting and multiple sheets, but gain the ability to be imported by almost any tool. That is a feature when moving data between systems and a problem when the CSV is the only copy.

Archives. ZIP is universally supported. 7z and RAR compress better but need extra software on many systems, which matters when sending files to someone else.

Formats and the long term

Files outlive software. Documents written in early-1990s word processors are often unreadable today without conversion tools that themselves are disappearing. For anything you want to keep for decades, favour formats that are open, widely used and documented: PDF/A for documents, PNG or TIFF for images that must not degrade, FLAC or WAV for audio masters, plain text or CSV for data. Storing a proprietary original alongside an open export is a reasonable compromise when the original preserves editing features.

Choosing formats that stay readable

  • Export finished work to a widely supported format before sharing it, and keep the editable original for yourself.
  • Do not repeatedly edit and re-save JPEGs or MP3s; work in a lossless format and export a lossy copy at the end.
  • When a file will not open, check the real type rather than the extension; many tools can identify a file by its signature.
  • Before relying on a cloud service or app, check how it lets you export your data and in which formats.
  • For archives meant to last, prefer open formats and store a note of what software created them.

Frequently asked questions

Does converting a file damage it?

Converting between lossless formats does not. Converting into a lossy format, or from one lossy format to another, discards information each time. Converting a low-resolution image into a high-resolution format does not restore detail that was never there.

Why does the same video play on one device and not another?

Usually because the device lacks support for the codec inside the container, or for a specific profile of that codec. Re-encoding into a widely supported codec such as H.264 in an MP4 container generally fixes it.

Is PDF always the best for documents?

It is best for distribution and archiving. It is poor for collaboration, because editing a PDF is awkward. Keep the source document for edits and generate the PDF from it.

Choosing a format is choosing who will be able to open your file, and how much of it will survive.

In short: A file format is a contract about how bytes are interpreted. Open, lossless and widely supported formats maximise compatibility and longevity; lossy and proprietary formats trade those qualities for size and features. Pick according to what the file is for.