Skip to content
Back to Blog
2026-06-20Reference

Common File Format Cheat Sheet for Developers

As a developer, you work with dozens of file formats daily. This cheat sheet provides a quick reference for the most common formats, their MIME types, and when you'll encounter them.

Documents

FormatExtensionMIME TypeUse Case
PDF.pdfapplication/pdfDocument sharing, printing
Word.docxapplication/vnd...wordprocessingmlWord processing
Excel.xlsxapplication/vnd...spreadsheetmlSpreadsheets, data
Text.txttext/plainPlain text, logs
Markdown.mdtext/markdownDocumentation, READMEs
RTF.rtfapplication/rtfRich text formatting

Images

FormatExtensionMIME TypeBest For
PNG.pngimage/pngLossless graphics, UI
JPEG.jpgimage/jpegPhotos
GIF.gifimage/gifAnimations
SVG.svgimage/svg+xmlVector graphics
WebP.webpimage/webpModern web images
BMP.bmpimage/bmpUncompressed bitmaps
ICO.icoimage/x-iconFavicons

Audio/Video

FormatExtensionMIME TypeNotes
MP4.mp4video/mp4Most compatible video
WebM.webmvideo/webmWeb-optimized video
MP3.mp3audio/mpegCompressed audio
WAV.wavaudio/wavUncompressed audio
OGG.oggaudio/oggOpen format

Data & Code

FormatExtensionMIME TypeUse Case
JSON.jsonapplication/jsonAPI data, config
CSV.csvtext/csvTabular data
XML.xmlapplication/xmlLegacy data exchange
YAML.ymlapplication/yamlConfiguration
TOML.tomlapplication/tomlRust/Python config

Archives

FormatExtensionMIME TypeNotes
ZIP.zipapplication/zipMost common archive
GZIP.gzapplication/gzipSingle-file compression
TAR.tarapplication/x-tarUnix archive (often .tar.gz)

Magic Bytes

Each file format has a unique "magic number" at the start of the file that identifies its type:

FormatMagic Bytes (hex)
PDF25 50 44 46 (%PDF)
PNG89 50 4E 47
JPEGFF D8 FF
GIF47 49 46 38 (GIF8)
ZIP50 4B 03 04 (PK)
PDF25 50 44 46

Understanding file formats and their magic bytes helps with file validation, type detection, and security testing.

#reference#file-formats#cheat-sheet