Skip to content

NES (.nes)

.nes file signature | application/x-nesrom

Nintendo Entertainment System ROM file[56]

Safe

Magic Bytes

Offset 0
4E 45 53 1A

Sources: Apache Tika, Wikipedia

All Known Signatures

2 signature variants are documented for .nes files across multiple sources.

Hex Signature Offset Sources
4E 45 53 1A 0 Apache Tika, Wikipedia
4E 45 53 0 Wikipedia

Extension

.nes

MIME Type

application/x-nesrom

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .nes files in Python

Python
def is_nes(file_path: str) -> bool:
    """Check if file is a valid NES by magic bytes."""
    signature = bytes([0x4E, 0x45, 0x53, 0x1A])
    with open(file_path, "rb") as f:
        return f.read(4) == signature

How to validate .nes files in Node.js

Node.js
function isNES(buffer: Buffer): boolean {
  const signature = Buffer.from([0x4E, 0x45, 0x53, 0x1A]);
  return buffer.subarray(0, 4).equals(signature);
}

How to validate .nes files in Go

Go
func IsNES(data []byte) bool {
    signature := []byte{0x4E, 0x45, 0x53, 0x1A}
    if len(data) < 4 {
        return false
    }
    return bytes.Equal(data[:4], signature)
}

API Endpoint

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

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .nes file?

A .nes file is a NES file. Nintendo Entertainment System ROM file[56]

What are the magic bytes for .nes files?

The magic bytes for NES files are 4E 45 53 1A at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .nes file?

To validate a .nes file, read the first bytes of the file and compare them against the known magic bytes (4E 45 53 1A) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .nes files?

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

Is it safe to open .nes files?

NES (.nes) 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.