Skip to content

Commodore 1541 GCR-encoded disk image (.g64)

.g64 file signature | application/octet-stream

G64 is a GCR-encoded disk image format for the Commodore 1541 floppy disk drive, originally defined for Commodore 64 software preservation and maintained by the retrocomputing community. It is used to archive, transfer, and emulate copy-protected and track-sensitive disk data in C64 emulators and preservation tools. The format is legacy and largely obsolete, and files are generally safe to open with compatible software.

Safe

Magic Bytes

Offset 0
47 43 52 2D 31 35 34 31

Sources: Schepers C64 Format Spec

All Known Signatures

2 signature variants are documented for .g64 files across multiple sources.

Hex Signature Offset Sources
47 43 52 2D 31 35 34 31 0 Schepers C64 Format Spec
47 65 6E 65 74 65 63 20 4F 6D 6E 69 63 61 73 74 0 Gary Kessler

Extension

.g64

MIME Type

application/octet-stream

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .g64 files in Python

Python
def is_g64(file_path: str) -> bool:
    """Check if file is a valid G64 by magic bytes."""
    signature = bytes([0x47, 0x43, 0x52, 0x2D, 0x31, 0x35, 0x34, 0x31])
    with open(file_path, "rb") as f:
        return f.read(8) == signature

How to validate .g64 files in Node.js

Node.js
function isG64(buffer: Buffer): boolean {
  const signature = Buffer.from([0x47, 0x43, 0x52, 0x2D, 0x31, 0x35, 0x34, 0x31]);
  return buffer.subarray(0, 8).equals(signature);
}

How to validate .g64 files in Go

Go
func IsG64(data []byte) bool {
    signature := []byte{0x47, 0x43, 0x52, 0x2D, 0x31, 0x35, 0x34, 0x31}
    if len(data) < 8 {
        return false
    }
    return bytes.Equal(data[:8], signature)
}

API Endpoint

GET /api/v1/g64
curl https://filesignature.org/api/v1/g64

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .g64 file?

A .g64 file is a Commodore 1541 GCR-encoded disk image file. G64 is a GCR-encoded disk image format for the Commodore 1541 floppy disk drive, originally defined for Commodore 64 software preservation and maintained by the retrocomputing community. It is used to archive, transfer, and emulate copy-protected and track-sensitive disk data in C64 emulators and preservation tools. The format is legacy and largely obsolete, and files are generally safe to open with compatible software.

What are the magic bytes for .g64 files?

The magic bytes for Commodore 1541 GCR-encoded disk image files are 47 43 52 2D 31 35 34 31 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .g64 file?

To validate a .g64 file, read the first bytes of the file and compare them against the known magic bytes (47 43 52 2D 31 35 34 31) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .g64 files?

There is no officially registered MIME type for .g64 files. Systems typically use application/octet-stream as a generic fallback when handling this format.

Is it safe to open .g64 files?

Commodore 1541 GCR-encoded disk image (.g64) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.