3GP file format
3GPP multimedia container, designed for mobile phones.
- MIME type
- video/3gpp
- Extensions
- .3gp
- Category
- Video
Magic-number signature
| 0x00000004 | 66747970 | ftyp | ISO-BMFF 'ftyp' box |
| 0x00000008 | 33677034 | 3gp4 | brand '3gp4' (or '3gp5') |
About the 3GP format
3GP is the multimedia container the 3rd Generation Partnership Project defined for mobile handsets, specified in 3GPP TS 26.244 as a restricted profile of the ISO base media file format. Structurally it is MP4: the same boxes, the same big-endian sizes, the same FileTypeBox at the front. What the specification adds is limits — a short list of permitted codecs, mainly H.263, MPEG-4 Part 2 and later H.264 for video, and AMR-NB, AMR-WB or AAC for audio — chosen so that a phone with a few megabytes of RAM and no hardware to speak of could record and play them. Files are small, resolutions are tiny by modern standards, and the format survives mostly in old camera rolls and in voice recordings taken on feature phones.
Header layout, byte by byte
| Offset | Length | Field | Meaning |
|---|---|---|---|
| 0 | 4 | ftyp box size | Big-endian length of the FileTypeBox counting these four bytes. 00 00 00 20 is 32, room for a major brand, a minor version and three compatible brands. The value is the only reliable way to find the box that follows. |
| 4 | 4 | Box type 'ftyp' | 66 74 79 70, required to be the first box in the file. Every ISO base media derivative puts it here, so its presence narrows a file to that family and no further. |
| 8 | 4 | Major brand | 33 67 70 followed by an ASCII digit: '3gp4', '3gp5', '3gp6' and later revisions, each corresponding to a release of TS 26.244. The digit is the closest thing the file has to a statement about which codecs to expect inside it. |
| 12 | 4 | Minor version | A big-endian 32-bit value carrying the specification release the writer targeted. A 3gp6 file produced by ffmpeg holds 00 00 01 00 here. Like every minor version in this family it is informative, and rejecting a file over its value is a bug. |
| 16 | variable | Compatible brands | Four bytes per brand until the box ends, typically the major brand repeated followed by isom, iso2 and avc1. Seeing isom listed here is the file saying a generic MP4 reader will cope, which is true far more often than the separate extension suggests. |
| 32 | 8 | Second box header | Size and type of the box following ftyp — 'moov', 'mdat' or a 'free' placeholder. The offset holds when the ftyp box is 32 bytes long and moves with the compatible-brands list otherwise. |
Telling it apart from its neighbours
| Easily confused with | How to tell |
|---|---|
| MP4 | The brand at offset 8 is the whole test: 3gp4, 3gp5 or 3gp6 rather than isom or mp42. Every 3GP file is a valid MP4 and will play in an MP4 reader, but the reverse fails — an MP4 carrying H.265, VP9 or AC-3 breaks the 3GPP codec restrictions even though its boxes parse without complaint. |
| 3G2 | 3GPP2 defined a near-identical container for CDMA networks, distinguished only by the brand '3g2a' or '3g2b' at offset 8 and the .3g2 extension. Its main addition is support for QCELP and EVRC speech codecs, which nothing outside that ecosystem decodes; everything else about the file is the same layout. |
| AMR | 3GP is often confused with the raw speech format it usually carries. A bare AMR file is not a container at all: it begins with the ASCII header line 23 21 41 4D 52 0A, '#!AMR' plus a newline, and then raw speech frames. Inside a 3GP the same audio is a proper track whose sample entry is 'samr', and there is no such header anywhere in the file. |
| M4A | Brand 'M4A ' at offset 8, and the same ISO box tree. Audio-only 3GP files exist and are common — a voice memo from an old handset is one — so the extension does not tell you whether video is present. The 'hdlr' handler type inside each track does: 'vide' for picture, 'soun' for sound. |
How these files break
- A recording cut off by a dying battery. The handset writes samples into mdat and appends the moov index when recording stops, so a phone that switched off mid-capture leaves a file with all its audio and video present and no way to play it. Recovery means grafting the sample-table structure from another clip recorded on the same handset at the same settings.
- Codecs no longer decodable. Many 3GP files hold H.263 video and AMR-NB speech, and modern players quietly dropped both. The file is entirely intact, the boxes walk cleanly, and playback still fails — which reads as corruption but is a codec availability problem, fixed by transcoding rather than repair.
- Truncation during a transfer off the handset. Because the header lives in the first thirty-two bytes it always survives, so file-type detection reports 3GP happily on a file missing most of its content. Walking the box sizes is what reveals it: the last box promises more bytes than exist.
- The brand lost in a remux. Copying streams through a tool that rewrites the FileTypeBox turns the bytes at offset 8 into isom. Nothing about the media changes and it plays exactly as before, but anything keying on the 3GP brand now sees a different format.
- Junk in front of the header. A partial download saved with an HTML error page ahead of it pushes 'ftyp' off offset 4. Chunk offsets inside the moov box are all measured from the start of the file, so the leading bytes have to be deleted rather than skipped over.
Where the format stands today
3GP had a specific job — video messaging and camera recording on phones between roughly 2002 and 2010 — and that job stopped existing when handsets got good enough to record straight into MP4 with H.264. Nothing new is produced in the format. Where it still turns up is archives: old MMS attachments, camera rolls from feature phones, voice notes, and surveillance or dashcam hardware that was cheap enough to keep an old encoder chip long after the phones moved on. For any of these the right move is to transcode once into MP4 with H.264 and AAC, because the container is not the problem — H.263 and AMR-NB are, and every year fewer players ship a decoder for them. The one genuine advantage 3GP retains is size: an AMR-NB voice recording is a few kilobytes per second, far below anything a general-purpose codec will produce.
Open 3GP files on this site
Every one of these runs in your browser — the file never leaves your machine.
Related formats
Formats that are easy to confuse with 3GP — compare their leading bytes.