How to use
- Paste the Base58 string into the input box. Spaces and line breaks are ignored.
- Read the decoded bytes as hexadecimal in the output.
- Copy the hex, or press Swap to turn hex back into Base58.
How Base58 turns into hex
Base58 reads the whole string as one large number written with the 58-character Bitcoin alphabet, which leaves out 0, O, I and l. Converting to hex writes the same number in base 16, two hex digits per byte, so nothing is added or lost.
Zero bytes at the start of the data have no numeric value, so Base58 records each one as a leading 1, the first character of its alphabet. The decoder turns every leading 1 back into a 00 byte. For example, 115Q decodes to 0000ff, and the Solana System Program address, thirty-two 1 characters in a row, decodes to 32 zero bytes. The conversion runs locally in your browser.
Bitcoin, Solana and IPFS examples
Spaces are added to the hex below to show the parts:
Bitcoin address (P2PKH, genesis block)
1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
00 62e907b15cbf27d5425399ebf6f0fb50ebb88f18 c29b7d93
version | hash160 (20 bytes) | checksum (4 bytes)
Solana public key (SPL Token program)
TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
06ddf6e1d765a193d9cbe146ceeb79ac1cb485ed5f5b37913a8cf5857eff00a9
32 bytes, no version byte, no checksum
IPFS CIDv0
QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG
12 20 9d6c2be50f706953479ab9df2ce3edca90b68053c00b3004b7f0accbe1e8eedf
sha2-256 | length 32 | digest
Legacy Bitcoin addresses start with 1 because their version byte is 00. P2SH addresses start with 3 and decode to version 05.
Base58Check checksums stay in the bytes
Bitcoin addresses and WIF private keys use Base58Check: four checksum bytes, taken from a double SHA-256 of the payload, are appended before encoding. This page uses plain Base58, so the checksum is decoded like any other data and appears as the last 8 hex digits. The hash160 of a legacy address is the 40 hex digits between the leading 00 and the checksum.
To confirm that an address is intact and get the payload without the checksum, decode it on the Base58Check page. Solana keys and IPFS hashes carry no checksum, so plain Base58 is the right choice for them.
Base58 to hex in code
# Python (pip install base58)
import base58
base58.b58decode('115Q').hex() # '0000ff'
// JavaScript (npm install bs58)
import bs58 from 'bs58';
Buffer.from(bs58.decode('115Q')).toString('hex'); // '0000ff'
Frequently asked questions
Why does a Bitcoin address decode to 25 bytes instead of 20?
A legacy address holds a 1-byte version, the 20-byte hash160 of the public key and a 4-byte checksum. Plain Base58 returns all three, so you get 50 hex digits. The hash160 is everything between the first byte and the last four.
Why does every leading 1 become 00?
In Base58 the character 1 stands for the value zero. Leading zero bytes would vanish if the data were treated as a plain number, so each one is written as a 1 and decoded back to a 00 byte.
Why do I get an invalid character error?
How long is a Solana public key?
Exactly 32 bytes, or 64 hex digits. In Base58 that is usually 43 or 44 characters. Keys that start with zero bytes can be shorter, as the System Program address shows.