Smart Deals - promotions, discount codes and sales

Ethereum Function Selector (EVM)

Paste a function signature to get its canonical form, Keccak-256 hash, and 4-byte selector.

Secure (SSL)
Client-Side Processing
100% Free
Instructions
  • 1
    Enter data
    Enter content, paste text or load a file from disk.
  • 2
    Click the button
    The tool will immediately process your data in the browser.
  • 3
    Get the result
    Copy the finished text or save the file to your device.
function runTool() {
  return "Result ready in 0.1s";
}

Rate this tool:

Related tools

Other tools you may find useful

How to use the EVM function selector

Type the function signature you want to check into the text field. You can paste it with the parameter names exactly as you see them in the contract documentation. Then click the “Calculate selector” button. The result also appears automatically when the page loads, so you immediately see the tool working on the default value.

  1. Type or paste a signature, for example transfer(address to, uint256 amount).
  2. Click “Calculate selector.”
  3. Read the three results: the canonical form, the full Keccak-256 hash, and the 4-byte selector.

For the default value, the canonical form is transfer(address,uint256), the full Keccak-256 hash is 0xa9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b, and the 4-byte selector is 0xa9059cbb. If the signature is invalid, an error message appears instead of the results. The entire calculation runs locally in your browser.

What is a function's canonical signature

A canonical signature is the simplest, unambiguous way to describe a function: its name, parentheses, and the list of parameter types, without variable names or extra words. That form is the basis for the rest of the calculation.

The tool normalizes the text you enter using several rules:

  • removes the optional function prefix and parameter names,
  • removes the words memory, calldata, storage, indexed, and payable,
  • changes uint to uint256 and int to int256,
  • changes byte to bytes1, including when the parameter is an array, for example uint[] becomes uint256[],
  • splits parameters by commas only at the top level of parentheses, so nested parentheses do not break the list.

The result always has the form name(type1,type2,...). This means two people writing the same function in different ways — one with parameter names, one without — get an identical description.

Keccak-256 vs. SHA3-256 in Ethereum

Ethereum does not use the version of SHA3-256 that was later standardized. It uses Keccak-256, an earlier version of the same family with different input padding. That is why Keccak-256 and SHA3-256 produce different results for the same text.

The tool computes Keccak-256 from the canonical form encoded in UTF-8. You get 32 bytes, shown as 0x plus 64 hexadecimal characters. This is exactly the same hash Ethereum uses to derive a function selector.

If you see the term “SHA3” in an Ethereum context, it almost always means Keccak-256. It is worth remembering, because computing SHA3-256 would give a different string and therefore a different selector.

How to read the 4-byte selector and full hash

A function selector is the first 4 bytes of the Keccak-256 hash. In hexadecimal notation, that means 0x plus 8 characters — exactly what you see in the “Selector (4 bytes)” row. The full hash has 32 bytes, or 0x plus 64 characters, and it appears in the “Keccak-256” row.

ResultLengthExample for the default value
Canonical formtexttransfer(address,uint256)
Keccak-25632 bytes0xa9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b
Selector (4 bytes)4 bytes0xa9059cbb

In practice, the selector tells you which contract function a transaction calls, while the full hash can be useful when you compare entire signatures. Note that the selector is always the beginning of the full hash — the first eight characters after 0x.

Tool limitations: tuples, type aliases, and ABI parsing

The tool normalizes signatures and computes the hash. It is not a full ABI parser or a contract code analyzer. Below are the main limits to know before using the result.

  • Tuples and complex types. Nested parentheses do not split the parameter list, but with complex types, structs, and tuples, check for yourself that the notation matches the definition in the contract.
  • Type aliases. Only the abbreviations described above are converted: uint, int, and byte. If you use a custom type name or an alias outside that list, it is treated literally and the result reflects your input.
  • No contract verification. The tool does not fetch source code or contract definitions, and it does not confirm that the function actually exists at a given address. You need to verify that yourself, for example in the project documentation or verified code.
  • Data scope. The tool does not read files, fetch results, or keep a calculation history. Everything happens locally in your browser, and nothing is sent to a server.
  • One signature at a time. You check a single entry, so if you have many functions, repeat the same step for each one separately.

If the result will go into production code, treat it as a starting point and compare it with the function definition in the contract. That way you can be sure the parameter types and their order match what actually runs on the network.

Frequently asked questions

What is an Ethereum function selector?

It is the first 4 bytes of the Keccak-256 hash computed from the canonical form of a function signature. In hexadecimal, it has 0x plus 8 characters, for example 0xa9059cbb. A contract uses this short code to recognize which function you are calling.

Why calculate a function selector?

A selector lets you determine which contract function a transaction calls and compare signatures from different sources. It is also useful when you manually build call data and want to confirm that the parameter types match.

How does Keccak-256 differ from SHA3-256?

They are two versions of the same hash family with different input padding, so they produce different results for the same text. Ethereum uses Keccak-256, not the later standardized SHA3-256.

How many bytes are in the selector and the full hash?

A function selector is 4 bytes, or 8 hexadecimal characters after 0x. The full Keccak-256 hash is 32 bytes, or 64 hexadecimal characters after 0x.

Do parameter names in the signature matter?

No. You can paste a signature with parameter names because the tool removes them and keeps only the types. The result is the same as for a version without names.

Are calculations performed in my browser?

Yes, everything is computed locally in your browser, and nothing is sent to a server. You can check signatures without worrying that the text you enter leaves your device.

This tool calculates locally in your browser; before using a selector in production, verify the canonical signature against ABI/Solidity documentation, especially for complex types.

Install Webp.pl Have the tools in your own pocket!