Skip to content

GTAR (.gtar)

.gtar file signature | application/x-gtar

Safe

Magic Bytes

Offset 257
75 73 74 61 72 20 20 00

Sources: Apache Tika

Extension

.gtar

MIME Type

application/x-gtar

Byte Offset

257

Risk Level

Safe

Validation Code

How to validate .gtar files in Python

Python
def is_gtar(file_path: str) -> bool:
    """Check if file is a valid GTAR by magic bytes."""
    signature = bytes([0x75, 0x73, 0x74, 0x61, 0x72, 0x20, 0x20, 0x00])
    with open(file_path, "rb") as f:
        return f.read(8) == signature

How to validate .gtar files in Node.js

Node.js
function isGTAR(buffer: Buffer): boolean {
  const signature = Buffer.from([0x75, 0x73, 0x74, 0x61, 0x72, 0x20, 0x20, 0x00]);
  return buffer.subarray(0, 8).equals(signature);
}

How to validate .gtar files in Go

Go
func IsGTAR(data []byte) bool {
    signature := []byte{0x75, 0x73, 0x74, 0x61, 0x72, 0x20, 0x20, 0x00}
    if len(data) < 8 {
        return false
    }
    return bytes.Equal(data[:8], signature)
}

API Endpoint

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

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .gtar file?

A .gtar file is a GTAR file.

What are the magic bytes for .gtar files?

The magic bytes for GTAR files are 75 73 74 61 72 20 20 00 at byte offset 257. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .gtar file?

To validate a .gtar file, read the first bytes of the file and compare them against the known magic bytes (75 73 74 61 72 20 20 00) at offset 257. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .gtar files?

The primary MIME type for .gtar files is application/x-gtar.

Is it safe to open .gtar files?

GTAR (.gtar) 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.