Skip to content

GP4 (.gp4)

.gp4 file signature | application/x-guitar-pro

Safe

Magic Bytes

Offset 1
46 49 43 48 49 45 52 20 47 55 49 54 41 52 45 20 50 52 4F 20

Sources: Apache Tika

All Known Signatures

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

Hex Signature Offset Sources
46 49 43 48 49 45 52 20 47 55 49 54 41 52 45 20 50 52 4F 20 1 Apache Tika
46 49 43 48 49 45 52 20 47 55 49 54 41 52 20 50 52 4F 20 1 Apache Tika

Extension

.gp4

MIME Type

application/x-guitar-pro

Byte Offset

1

Risk Level

Safe

Validation Code

How to validate .gp4 files in Python

Python
def is_gp4(file_path: str) -> bool:
    """Check if file is a valid GP4 by magic bytes."""
    signature = bytes([0x46, 0x49, 0x43, 0x48, 0x49, 0x45, 0x52, 0x20, 0x47, 0x55, 0x49, 0x54, 0x41, 0x52, 0x45, 0x20, 0x50, 0x52, 0x4F, 0x20])
    with open(file_path, "rb") as f:
        return f.read(20) == signature

How to validate .gp4 files in Node.js

Node.js
function isGP4(buffer: Buffer): boolean {
  const signature = Buffer.from([0x46, 0x49, 0x43, 0x48, 0x49, 0x45, 0x52, 0x20, 0x47, 0x55, 0x49, 0x54, 0x41, 0x52, 0x45, 0x20, 0x50, 0x52, 0x4F, 0x20]);
  return buffer.subarray(0, 20).equals(signature);
}

How to validate .gp4 files in Go

Go
func IsGP4(data []byte) bool {
    signature := []byte{0x46, 0x49, 0x43, 0x48, 0x49, 0x45, 0x52, 0x20, 0x47, 0x55, 0x49, 0x54, 0x41, 0x52, 0x45, 0x20, 0x50, 0x52, 0x4F, 0x20}
    if len(data) < 20 {
        return false
    }
    return bytes.Equal(data[:20], signature)
}

API Endpoint

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

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .gp4 file?

A .gp4 file is a GP4 file.

What are the magic bytes for .gp4 files?

The magic bytes for GP4 files are 46 49 43 48 49 45 52 20 47 55 49 54 41 52 45 20 50 52 4F 20 at byte offset 1. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .gp4 file?

To validate a .gp4 file, read the first bytes of the file and compare them against the known magic bytes (46 49 43 48 49 45 52 20 47 55 49 54 41 52 45 20 50 52 4F 20) at offset 1. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .gp4 files?

The primary MIME type for .gp4 files is application/x-guitar-pro.

Is it safe to open .gp4 files?

GP4 (.gp4) 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.