Skip to content
ihategas.xyz

Interface ID

XOR function selectors into an ERC-165 interface ID.

Runs offline

one per line, no argument names

Paste the interface's function signatures to XOR their selectors into an ERC-165 ID.

About interface id

ERC-165 lets a contract answer whether it implements a given interface, and the identifier for that interface is simply every function selector in it XORed together. ERC-721 comes out as 0x80ac58cd, ERC-1155 as 0xd9b67a26. Order does not matter because XOR is commutative, but completeness does — miss one function and the identifier is wrong.

Common questions

What is an ERC-165 interface ID?

The XOR of all function selectors in an interface. Contracts that implement supportsInterface return true for IDs they claim to support, which is how wallets detect ERC-721 versus ERC-1155 without guessing.

How do I calculate an interface ID?

List the function signatures, take each four-byte selector, and XOR them together. This page does that arithmetic from the signatures you enter, matching the EIP definition.

Does a matching interface ID prove a contract is safe?

No. It only claims a set of function selectors. Malicious contracts can report interface IDs they do not honestly implement. Treat ERC-165 as discovery, not as a safety check.

More developer tools