ELC (.elc)
.elc file signature | application/x-elc
ELC is a compiled Emacs Lisp file used by GNU Emacs, a text editor developed and maintained by the GNU Project. It stores byte-compiled Lisp code for editor extensions, configuration files, and packages that load faster than their source forms. Like other executable code files, it should be opened only from trusted sources; the format is established and generally considered safe in normal use.
Magic Bytes
Offset 0
0A 28
Sources: Apache Tika
All Known Signatures
2 signature variants are documented for .elc files across multiple sources.
| Hex Signature | Offset | Sources |
|---|---|---|
| 0A 28 | 0 | Apache Tika |
| 3B 45 4C 43 13 00 00 00 | 0 | Apache Tika |
Extension
.elc
MIME Type
application/x-elc
Byte Offset
0
Risk Level
Safe
Validation Code
How to validate .elc files in Python
def is_elc(file_path: str) -> bool:
"""Check if file is a valid ELC by magic bytes."""
signature = bytes([0x0A, 0x28])
with open(file_path, "rb") as f:
return f.read(2) == signature
How to validate .elc files in Node.js
function isELC(buffer: Buffer): boolean {
const signature = Buffer.from([0x0A, 0x28]);
return buffer.subarray(0, 2).equals(signature);
}
How to validate .elc files in Go
func IsELC(data []byte) bool {
signature := []byte{0x0A, 0x28}
if len(data) < 2 {
return false
}
return bytes.Equal(data[:2], signature)
}
API Endpoint
/api/v1/elc
curl https://filesignature.org/api/v1/elc
See the full API documentation for all endpoints and parameters.
Frequently Asked Questions
What is a .elc file?
A .elc file is identified by the magic bytes 0A 28 at byte offset 0. ELC is a compiled Emacs Lisp file used by GNU Emacs, a text editor developed and maintained by the GNU Project. It stores byte-compiled Lisp code for editor extensions, configuration files, and packages that load faster than their source forms. Like other executable code files, it should be opened only from trusted sources; the format is established and generally considered safe in normal use.
What are the magic bytes for .elc files?
The magic bytes for ELC files are 0A 28 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.
How do I validate a .elc file?
To validate a .elc file, read the first bytes of the file and compare them against the known magic bytes (0A 28) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.
What is the MIME type for .elc files?
The primary MIME type for .elc files is application/x-elc.
Is it safe to open .elc files?
ELC (.elc) 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.