---
eip: 55
label: ERC-55
title: Mixed-case checksum address encoding
status: Final
type: Standards Track
category: ERC
created: 2016-01-14
official: https://eips.ethereum.org/EIPS/eip-55
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-55.md
canonical: https://eips.huatuo.xyz/eip-55/
lang: en
tldr: Adds a checksum to Ethereum addresses by capitalizing some hex letters, so wallets can catch most typos without changing the address format.
tags: [address, checksum, wallet, encoding]
---

# ERC-55: Mixed-case checksum address encoding

**TL;DR:** Adds a checksum to Ethereum addresses by capitalizing some hex letters, so wallets can catch most typos without changing the address format.

## What problem does it solve?

An Ethereum address is just 20 bytes written as 40 hex characters. Raw hex has no built-in error detection. If you mistype one character, the result is still a valid address, and any ETH you send there is most likely lost forever.

EIP-55 adds a checksum without changing the length or the characters of the address. Hex is case-insensitive, so the case of each letter is free to carry extra information. Old software that ignores case keeps working, and new software can check the case.

## How it works

1. Take the address as **lowercase** hex without `0x` (40 ASCII characters).
2. Hash that ASCII string with Keccak-256.
3. For each character at position `i`:
   - digits `0-9` stay as they are;
   - letters `a-f` become **uppercase** if the `i`-th hex digit of the hash is 8 or higher, and stay lowercase otherwise.

The result looks like `0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed`. A wallet that receives a mixed-case address recomputes the checksum and rejects it if the case does not match.

The spec gives the numbers: an address has about 15 check bits on average, and a mistyped address passes by accident only about 0.0247% of the time. That is weaker than a 4-byte checksum, but it costs nothing in length.

## Sample code

A minimal implementation (TypeScript, ethers v6 for Keccak):

```ts
import { keccak256, toUtf8Bytes } from "ethers";

function toChecksumAddress(address: string): string {
  const hex = address.toLowerCase().replace(/^0x/, "");
  const hash = keccak256(toUtf8Bytes(hex)).slice(2); // hash the ASCII string, not the bytes
  let out = "0x";
  for (let i = 0; i < hex.length; i++) {
    out += parseInt(hash[i], 16) >= 8 ? hex[i].toUpperCase() : hex[i];
  }
  return out;
}

toChecksumAddress("0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359");
// "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"
```

In practice, use the library function. It also throws on a bad checksum:

```ts
import { getAddress } from "ethers";

getAddress("0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359"); // returns checksummed form
getAddress("0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d358"); // throws: bad address checksum
```

## Things to know

- All-lowercase and all-uppercase addresses carry no checksum. Most libraries accept them as "unchecked" and only validate mixed-case input.
- The hash input is the lowercase hex *string*, not the 20 raw bytes. Hashing the bytes is a common bug.
- The checksum does not depend on the chain, so the same address is valid on every EVM chain. [EIP-1191](/eip-1191/) proposes an optional chain-specific variant, but most wallets use plain EIP-55.
- EIP-55 is used almost everywhere: wallets, block explorers, Solidity (which requires checksummed address literals) and RPC methods such as [EIP-747](/eip-747/) `wallet_watchAsset`.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-55
