# File Format

> The rules for how a file stores its data. A program must know them to open it.

**Field:** Software Development  
**Category:** Files & Formats  
**Also known as:** Kind of File, Format of a File

## Think of it like

Think of it like a language. A letter in French needs a reader who knows French.

## Definition

A file format is the set of rules for how a file stores its data. It says what each byte means and in what order. A program must know the format to open the file. PNG is a format for pictures, MP3 is one for sound, and JSON is one for data. Two files can hold the same thing in different formats.

## Example

Lucy saves a drawing as a PNG and sends it to Jack. His photo app knows PNG, so the picture opens at once.

## Why it matters

Formats are how programs share work. If nothing on your computer knows a format, the file is just noise.

## Common mistake

Thinking that renaming a file changes its format. The name changes, but the bytes inside stay the same.

## Three principles

- **Rules for bytes.** It says what each byte means.
- **The reader must know.** A program needs the format to open it.
- **Many for one job.** Pictures alone have PNG, JPEG and more.

## Related terms

- [File Extension](https://learn.benibix.com/term/development/file-extension)
- [Plain Text File](https://learn.benibix.com/term/development/plain-text-file)
- [Binary File](https://learn.benibix.com/term/development/binary-file)
- [Media Type (MIME Type)](https://learn.benibix.com/term/development/mime-type)
- [JavaScript Object Notation (JSON)](https://learn.benibix.com/term/development/json)
- [Image Compression](https://learn.benibix.com/term/design/image-compression)

## Taught in

- [File Formats and Extensions](https://learn.benibix.com/learn/development-formats/file-formats-and-extensions): File Formats, 1/11

![Two panels. On the left, notes.txt, with .txt picked out, holds two readable lines, Buy milk and Call Jack at 5, and carries the label text/plain. On the right, photo.png, with .png picked out, holds rows of hex bytes starting 89 50 4E 47, and carries the label image/png. Notes under them say the ending after the dot is the file extension and the label is the media type a server sends.](https://learn.benibix.com/diagrams/dev2-file-types.svg)

---

Source: https://learn.benibix.com/term/development/file-format
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
