Upload a file
  1. base64hub
  2. Other bases
  3. Base58 decoder

Base58 Decoder: Base58 to Hex and Text

Paste a Base58 string to see the bytes inside as hex. Leading 1s come back as zero bytes, and the output can be switched to text or Base64 when you need it.

Free no sign-up, no limits Local nothing uploaded Hex out with text and Base64 one click away Updated Oct 27, 2026
Input 0Bytes 0 BOutput 0

Processed in your browser. This page cannot send your data anywhere – how we know

How to decode Base58

  1. Paste the string into Input · Base58. Spaces and line breaks are ignored.
  2. Read the bytes in Output · Hex. Under the output you can switch Case, add a Separator such as a space or :, or break the dump into 16 or 32 Bytes per line.
  3. If the string is not Bitcoin-style Base58, change Alphabet under the input to Flickr or Ripple.
  4. For other views, change To: Text if the data was a string, Base64 for an API or config file. Base58 to Base64 is a page set up for that conversion.
  5. Copy output, Download the hex, or Save bytes to get the decoded bytes as a file.

What common Base58 strings decode to

Base58Bytes (hex)What it is
1111111111111111111111111111111132 × 00Solana System Program (32-byte key of zeros)
TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA06ddf6e1d765…7eff00a9 (32 bytes)Solana SPL Token program ID
1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa00 62e907b1…ebb88f18 c29b7d93Bitcoin genesis block address: version, hash, checksum
QmQudp5N7EzTxrBk3yESEKyEroMYNd7R22G2KWffwNZyzq1220 262a86b6…e0882d8aIPFS CIDv0: SHA-256 multihash header, 32-byte digest
9Ajdvzr48656c6c6fThe text Hello

Reading the bytes tells you the structure. A 25-byte result starting with 00 or 05 is a Bitcoin address with its checksum still attached, a 34-byte result starting with 1220 is a CIDv0, and 32 bytes with no visible structure is most likely a public key.

Leading 1s are zero bytes

In Base58 every leading 1 decodes to one 00 byte, and the rest of the string decodes as a single number. This decoder keeps those bytes, so the genesis address above returns 25 bytes, not 24. A decoder that converts only the number loses them, and the first sign is usually a key that is one byte short or a checksum that never matches.

The rule runs the other way too: 1111 is four zero bytes, while 2 is the single byte 01.

When decoding fails

  • Unexpected character "0", "O", "I" or "l". These four are not in the Base58 alphabet, which leaves them out because they look like other characters. The error gives the position; it is usually a transcription mistake.
  • Unexpected +, / or =. The string is Base64. Use the Base64 decoder.
  • The input starts with bc1. That is a Bech32 SegWit address, a different encoding with its own checksum and alphabet. It either fails here or decodes to meaningless bytes.
  • The hex is right but too long by 4 bytes. You decoded a Base58Check value as plain Base58. The last 4 bytes are the checksum; drop them or use Base58Check.
  • Input over 64 KB. Base58 treats the whole input as one number, so the tool stops at 64 KB to stay responsive. Real Base58 values are a few dozen characters.

Decode Base58 to hex in JavaScript

BigInt makes the conversion short. This works in browsers and in Node.js:

const ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";

function base58ToHex(s) {
  let n = 0n;
  for (const ch of s) {
    const v = ALPHABET.indexOf(ch);
    if (v < 0) throw new Error(`not Base58: ${ch}`);
    n = n * 58n + BigInt(v);
  }
  let hex = n === 0n ? "" : n.toString(16);
  if (hex.length % 2) hex = "0" + hex;
  const zeros = s.length - s.replace(/^1+/, "").length;
  return "00".repeat(zeros) + hex;
}

base58ToHex("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa");
// '0062e907b15cbf27d5425399ebf6f0fb50ebb88f18c29b7d93'

For more byte handling in JavaScript, see the JavaScript page.

FAQ

How do I decode a Solana address?

Paste it here: the hex output is the 32-byte Ed25519 public key. The System Program address 11111111111111111111111111111111 decodes to 32 zero bytes, which is a quick way to see the leading-zero rule at work.

Why does my Bitcoin address decode to 25 bytes?

A legacy address is Base58Check: 1 version byte, a 20-byte public key hash and a 4-byte checksum. Plain Base58 decoding returns all 25 bytes. The Base58Check decoder verifies the checksum and strips it for you.

Why does the decoder reject my string?

Base58 has no 0, O, I or l, so one of those usually means a typo or a different encoding. A string with +, / or = is Base64, and 0x… is hex.

How do I convert Base58 to hex in JavaScript?

Multiply up a BigInt digit by digit, print it with toString(16), then add 00 for each leading 1. The snippet on this page shows the whole function.