Skip to content

Compressed archive file (.lzh)

.lzh file signature | application/octet-stream

Lempel Ziv Huffman archive fileMethod 5 (8 KiB sliding window)

Safe

Magic Bytes

Offset 10
23 20 54 68 69 73 20 69 73 20 61 20 73 68 65 6C 6C 20 61 72 63 68 69 76 65

Sources: Apache Tika

All Known Signatures

9 signature variants are documented for .lzh files across multiple sources.

Hex Signature Offset Sources
23 20 54 68 69 73 20 69 73 20 61 20 73 68 65 6C 6C 20 61 72 63 68 69 76 65 10 Apache Tika
1F 1E 0 Apache Tika
30 31 37 34 33 37 0 Apache Tika
1F FF 0 Apache Tika
FF 1F 0 Apache Tika
30 31 34 35 34 30 35 0 Apache Tika
2D 6C 68 30 2D 2 Wikipedia
2D 6C 68 35 2D 2 Wikipedia
2D 6C 68 2 Gary Kessler

Extension

.lzh

MIME Type

application/octet-stream

Byte Offset

10

Risk Level

Safe

Validation Code

How to validate .lzh files in Python

Python
def is_lzh(file_path: str) -> bool:
    """Check if file is a valid LZH by magic bytes."""
    signature = bytes([0x23, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x68, 0x65, 0x6C, 0x6C, 0x20, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65])
    with open(file_path, "rb") as f:
        return f.read(25) == signature

How to validate .lzh files in Node.js

Node.js
function isLZH(buffer: Buffer): boolean {
  const signature = Buffer.from([0x23, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x68, 0x65, 0x6C, 0x6C, 0x20, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65]);
  return buffer.subarray(0, 25).equals(signature);
}

How to validate .lzh files in Go

Go
func IsLZH(data []byte) bool {
    signature := []byte{0x23, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x68, 0x65, 0x6C, 0x6C, 0x20, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65}
    if len(data) < 25 {
        return false
    }
    return bytes.Equal(data[:25], signature)
}

API Endpoint

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

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .lzh file?

A .lzh file is a Compressed archive file file. Lempel Ziv Huffman archive fileMethod 5 (8 KiB sliding window)

What are the magic bytes for .lzh files?

The magic bytes for Compressed archive file files are 23 20 54 68 69 73 20 69 73 20 61 20 73 68 65 6C 6C 20 61 72 63 68 69 76 65 at byte offset 10. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .lzh file?

To validate a .lzh file, read the first bytes of the file and compare them against the known magic bytes (23 20 54 68 69 73 20 69 73 20 61 20 73 68 65 6C 6C 20 61 72 63 68 69 76 65) at offset 10. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .lzh files?

The primary MIME type for .lzh files is application/octet-stream.

Is it safe to open .lzh files?

Compressed archive file (.lzh) 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.