Bech32 / Bech32m Encoder & Decoder

Build a checksummed Bech32 or Bech32m string from a prefix and data, or decode and validate one back to its parts — all locally in your browser, no upload, no sign-up.

Result

What this tool does

Encode a human-readable prefix (HRP) plus a data payload into a checksummed Bech32 (BIP 173) or Bech32m (BIP 350) string, or decode and validate an existing Bech32 string back into its prefix, checksum variant, and data.

Bech32 is the encoding behind SegWit Bitcoin addresses (bc1…), Taproot addresses, Lightning invoices (lnbc…), Nostr keys (npub… / nsec…), and many Cosmos-ecosystem addresses. It packs bytes into a base-32 alphabet, adds a 1 separator after the prefix, and appends a 6-character BCH checksum that reliably catches typos and altered characters.

Everything runs locally in WebAssembly. Your input is never uploaded.

Encode vs decode

Bech32 vs Bech32m

VariantChecksum constantUsed by
Bech321SegWit v0 outputs — native P2WPKH / P2WSH addresses.
Bech32m0x2bc830a3SegWit v1+ (Taproot) addresses and newer schemes.

Bech32m was introduced in BIP 350 to fix an insertion-weakness in the original checksum. On decode the correct variant is detected automatically.

Data formats

Examples

InputSettingsOutput
751e76e8199196d454941c45d1b3a323f1433bd6encode · bc · bech32 · hexbc1w508d6qejxtdg4y5r3zarvary0c5xw7kj7gz7z
bc1w508d6qejxtdg4y5r3zarvary0c5xw7kj7gz7zdecode · hexhrp: bc · variant: bech32 · data: 751e76…3bd6
helloencode · test · bech32m · texttest1dpjkcmr0scqr9j
test1dpjkcmr0scqr9jdecode · texthrp: test · variant: bech32m · data: hello

Tips

Frequently asked questions

Is this the same as generating a Bitcoin address?

Not quite. A full SegWit address prepends a witness-version symbol to the program before Bech32-encoding it. This tool encodes the raw data you give it under the prefix you choose, which is the underlying primitive — handy for inspecting, learning, or building the address layer yourself.

Which variant should I use — Bech32 or Bech32m?

Use Bech32 for SegWit v0 (legacy native SegWit) and Bech32m for SegWit v1+ / Taproot and other newer schemes. When decoding you don't have to choose — the correct variant is detected from the checksum and reported back to you.

Why does decoding sometimes fail with a checksum error?

A single altered, inserted, or dropped character changes the BCH checksum, so the string no longer validates. That is the whole point of Bech32: it catches typos before you send funds to a wrong address.

Can I decode a Nostr npub or a Lightning invoice?

Yes — paste it and decode. You'll get the prefix (e.g. npub or lnbc), the variant, and the raw data bytes. Nostr keys use Bech32; switch the data format to hex to read the 32-byte key.

Does my data leave my device?

No. The encoder/decoder is compiled to WebAssembly and runs entirely in your browser. Nothing is uploaded to a server.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool bech32-codec "751e76e8199196d454941c45d1b3a323f1433bd6"

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/bech32-codec/?input=751e76e8199196d454941c45d1b3a323f1433bd6&mode=encode&hrp=bc&variant=bech32&format=hex

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.