Bech32 Encoder

Enter a human-readable prefix and the data hex bytes to encode.

Result

bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4
bc
20 bytes

How it is calculated

The tool builds a SegWit address in the style of BIP173 (version 0) and BIP350 (version 1 and up). The prefix (HRP) must be lowercase ASCII, 1 to 83 characters; the witness version is a number from 0 to 16. The hex data may contain spaces and a leading 0x, but must have an even number of digits and be 2 to 40 bytes; for version 0 it must be exactly 20 or 32 bytes. The bytes are regrouped from 8-bit to 5-bit values with zero padding, the version is placed in front, and a 6-symbol checksum is added. Version 0 uses checksum constant 1 (bech32); versions 1 to 16 use 0x2bc830a3 (bech32m). Symbols come from qpzry9x8gf2tvdw0s3jn54khce6mua7l, giving HRP + "1" + version + data + checksum. Anything invalid, or an output over 90 characters, shows no result.

Worked example

Take prefix bc, version 0 and the 20-byte program 751e76e8…3bd6. That is 20 bytes, or 160 bits. Regrouped into 5-bit values this is 32 symbols; the first byte 01110101 and the start of the next, 00011110, give 01110, 10100, 01111, which map to w, 5, 0. The version 0 maps to the symbol q and goes first, and 6 checksum symbols follow the data. The tool prints bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4 with prefix bc and 20 bytes. Changing only the version to 1 gives bc1pw508d6qejxtdg4y5r3zarvary0c5xw7kj9wkru, because bech32m uses a different checksum constant.

Try this example →

Common mistakes

  • Entering uppercase letters in the prefix, such as BC. BIP173 does not allow mixed case, so the tool shows no result instead of lowercasing it for you; type bc.
  • Using a 21-byte or 19-byte program with version 0. Version 0 addresses carry exactly 20 bytes (key hash) or 32 bytes (script hash); other lengths are rejected. Only versions 1 to 16 accept 2 to 40 bytes.
  • Pasting a hex string with an odd digit count or non-hex characters. Each byte needs two digits, so abc is invalid while 0abc is fine.
  • Using the wrong prefix for the network. bc is Bitcoin mainnet and tb is testnet; the same bytes give a different string and checksum, and funds sent to the wrong network address are not recoverable.
  • Sending real funds to an address made from made-up bytes. The tool only encodes what you type; it cannot know whether anyone holds the key behind that program.

About this calculator

Bech32 is the checksummed text encoding defined in BIP173 for representing Bitcoin's SegWit (native witness) addresses. It combines a human-readable prefix — like “bc” for Bitcoin mainnet — with the witness program data, encoded using a 32-character alphabet chosen to minimize the chance of transcription errors and support strong error detection.

Bech32 addresses are the ones that start with “bc1”, and their checksum lets a wallet reliably catch mistyped or corrupted addresses before funds are sent to the wrong place — a major usability improvement over the older Base58Check format. Wallet developers, exchange engineers, and blockchain tooling builders use encoders like this to generate and validate bech32 addresses when implementing SegWit support.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators