GP4 (.gp4)
.gp4 file signature | application/x-guitar-pro
GP4 is a Guitar Pro 4 song file format developed by Arobas Music for storing guitar tablature and musical scores. It is used to create, edit, and play back arrangements in Guitar Pro and compatible notation software, supporting instruments, lyrics, and playback settings. As a legacy format from an older version of Guitar Pro, it is generally safe to open, though files from untrusted sources should still be handled with standard caution.
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
def is_gp4(file_path: str) -> bool:
"""Check if file is a valid GP4 by magic bytes at offset 1."""
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:
f.seek(1)
return f.read(20) == signature
How to validate .gp4 files in 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]);
if (buffer.length < 21) return false;
return buffer.subarray(1, 21).equals(signature);
}
How to validate .gp4 files in 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) < 21 {
return false
}
return bytes.Equal(data[1:21], signature)
}
API Endpoint
/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 identified by the magic bytes 46 49 43 48 49 45 52 20 47 55 49 54 41 52 45 20 50 52 4F 20 at byte offset 1. GP4 is a Guitar Pro 4 song file format developed by Arobas Music for storing guitar tablature and musical scores. It is used to create, edit, and play back arrangements in Guitar Pro and compatible notation software, supporting instruments, lyrics, and playback settings. As a legacy format from an older version of Guitar Pro, it is generally safe to open, though files from untrusted sources should still be handled with standard caution.
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.