SXW
application/vnd.sun.xml.writer
Magic Bytes
Offset: 0
50 4B
SXW is an XML-based word processing format originally developed by Sun Microsystems for the StarOffice and early OpenOffice.org software suites. It was primarily used to store rich text documents and facilitate document exchange across open-source platforms prior to the adoption of modern standards. As a legacy format superseded by the OpenDocument Format, it is largely obsolete but remains safe for use, provided users remain vigilant against potential macro-based security risks.
Validation Code
How to validate .sxw files in Python
Python
def is_sxw(file_path: str) -> bool:
"""Check if file is a valid SXW by magic bytes."""
signature = bytes([0x50, 0x4B])
with open(file_path, "rb") as f:
return f.read(2) == signature
How to validate .sxw files in Node.js
Node.js
function isSXW(buffer: Buffer): boolean {
const signature = Buffer.from([0x50, 0x4B]);
return buffer.subarray(0, 2).equals(signature);
}
Go
func IsSXW(data []byte) bool {
signature := []byte{0x50, 0x4B}
if len(data) < 2 {
return false
}
return bytes.Equal(data[:2], signature)
}
API Endpoint
GET
/api/v1/sxw
curl https://filesignature.org/api/v1/sxw