ByteScope

3GP file format

3GPP multimedia container, designed for mobile phones.

MIME type
video/3gpp
Extensions
.3gp
Category
Video

Magic-number signature

0x0000000466747970ftypISO-BMFF 'ftyp' box
0x00000008336770343gp4brand '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

OffsetLengthFieldMeaning
04ftyp box sizeBig-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.
44Box 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.
84Major brand33 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.
124Minor versionA 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.
16variableCompatible brandsFour 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.
328Second box headerSize 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 withHow to tell
MP4The 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.
3G23GPP2 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.
AMR3GP 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.
M4ABrand '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.

FormatFirst bytesExtension
MP466 74 79 70.mp4
M4A66 74 79 70.m4a

Frequently asked questions

What is a magic number in a file?

The first few bytes of a file, which identify its format regardless of what the name says. A PNG always starts with 89 50 4E 47; a ZIP with 50 4B 03 04. Operating systems, browsers and the file command all read these bytes rather than trusting the extension, which is why renaming a file does not change what it actually is.

How do I check a file's magic number myself?

On macOS or Linux, xxd -l 16 yourfile prints the first 16 bytes; on Windows, Format-Hex -Path yourfile -Count 16 in PowerShell. Or drop the file into the File Type Identifier on this site, which reads the bytes locally and names the format for you — nothing is uploaded.

Why do two formats share the same magic number?

Because one is built on the other. Every docx, xlsx, pptx, apk, jar and epub begins with the ZIP signature, since all of them are ZIP archives underneath; telling them apart means looking at the entries inside. Java class files and macOS universal binaries both start with CA FE BA BE and are distinguished by the field that follows.

Can a file have no magic number at all?

Yes. Text-based formats — XML, HTML, JSON, SVG, CSV — have no fixed byte signature, so they are recognized structurally instead: a leading <?xml declaration, a <svg element, or a { followed by a quoted key. That detection is a good guess rather than a certainty, which is why this reference marks those formats as probe-detected.

Does a matching magic number mean the file is safe?

No. It tells you what the format is, not whether the contents are harmless — a genuine PDF or docx can still carry a malicious payload. Identifying the true type is a useful first check, especially when the extension disagrees with the bytes, but it is not a malware scan.

Have a file that might be in the 3GP format? Identify it with the File Type Identifier — it reads the magic number locally, nothing is uploaded. Or browse all formats.