File Extension vs. File Format

3 min read · Updated 2026-07-30

The extension is a naming convention

The extension is the suffix added to a filename so operating systems and users can identify the expected format. It is easy to change and does not transform the bytes inside the file.

The format is the actual organization of that data: headers, structures, compression, encoding, and metadata that a compatible program understands.

Example: renaming PNG to JPG

If you rename photo.png to photo.jpg, the file still begins with PNG signatures and still contains PNG-encoded image data. Image viewers that trust the extension may show an error, while tools that inspect content may still read it as PNG.

Converting a file requires a converter that decodes the source format and writes a new file in the target format. Renaming never performs that step.

Use signatures when the label is uncertain

Many formats begin with recognizable signatures. PDF files often start with %PDF-, ZIP-based files often start with PK, and JPEG images often start with FF D8 FF.

A hex viewer or file analyzer can compare those signatures with the declared extension. This is useful when a file arrives with an unexpected extension or a double extension.