Macromedia Shockwave Flash player file (.swf)
.swf file signature | application/vnd.adobe.flash.movie
Macromedia Shockwave Flash player file (LZMA compressed, SWF 13 and later).SeeSWF File Format Specification.
Magic Bytes
Offset 0
43 57 53
Sources: Apache Tika, Wikipedia, Gary Kessler
All Known Signatures
4 signature variants are documented for .swf files across multiple sources.
| Hex Signature | Offset | Sources |
|---|---|---|
| 43 57 53 | 0 | Apache Tika, Wikipedia, Gary Kessler |
| 46 57 53 | 0 | Apache Tika, Gary Kessler |
| 5A 57 53 | 0 | Gary Kessler |
| 57 53 | 0 | Neil Harvey FileSignatures |
Extension
.swf
MIME Type
application/vnd.adobe.flash.movie, application/x-shockwave-flash
Byte Offset
0
Risk Level
Safe
Validation Code
How to validate .swf files in Python
def is_swf(file_path: str) -> bool:
"""Check if file is a valid SWF by magic bytes."""
signature = bytes([0x43, 0x57, 0x53])
with open(file_path, "rb") as f:
return f.read(3) == signature
How to validate .swf files in Node.js
function isSWF(buffer: Buffer): boolean {
const signature = Buffer.from([0x43, 0x57, 0x53]);
return buffer.subarray(0, 3).equals(signature);
}
How to validate .swf files in Go
func IsSWF(data []byte) bool {
signature := []byte{0x43, 0x57, 0x53}
if len(data) < 3 {
return false
}
return bytes.Equal(data[:3], signature)
}
API Endpoint
/api/v1/swf
curl https://filesignature.org/api/v1/swf
See the full API documentation for all endpoints and parameters.
Frequently Asked Questions
What is a .swf file?
A .swf file is a Macromedia Shockwave Flash player file file. Macromedia Shockwave Flash player file (LZMA compressed, SWF 13 and later).SeeSWF File Format Specification.
What are the magic bytes for .swf files?
The magic bytes for Macromedia Shockwave Flash player file files are 43 57 53 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.
How do I validate a .swf file?
To validate a .swf file, read the first bytes of the file and compare them against the known magic bytes (43 57 53) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.
What is the MIME type for .swf files?
The primary MIME type for .swf files is application/vnd.adobe.flash.movie. Additional MIME types include: application/vnd.adobe.flash.movie, application/x-shockwave-flash.
Is it safe to open .swf files?
Macromedia Shockwave Flash player file (.swf) 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.