Upload a file
  1. base64hub
  2. Other bases
  3. Base64 to Base58

Base64 to Base58 Converter Online

Paste Base64 and get the same bytes as Base58, with the Bitcoin alphabet that Solana and IPFS use. URL-safe Base64, missing padding and line breaks are accepted.

Free no sign-up, no limits Local nothing uploaded Lenient URL-safe and unpadded Base64 accepted 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 convert Base64 to Base58

  1. Paste the Base64 string into Input · Base64. Standard and URL-safe characters both work, and so do missing = padding, line breaks and a data: prefix.
  2. Read the result in Output · Base58.
  3. Pick the Alphabet under the output if the target is not Bitcoin-style Base58. Flickr and Ripple order the same 58 characters differently.
  4. Copy output, or click Base58 → Base64 in the direction toggle to go back. The Base58 to Base64 page starts in that direction.

The conversion goes through the raw bytes: Base64 is decoded, and the bytes are encoded as Base58. Nothing is added or removed, so a 32-byte key stays a 32-byte key.

Examples

Base64Base58What it is
SGVsbG8=9AjdvzrThe text Hello
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=1111111111111111111111111111111132 zero bytes: the Solana System Program
Bt324ddloZPZy+FGzut5rBy0he1fWzeROoz1hX7/AKk=TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DASolana SPL Token program ID
Bt324ddloZPZy-FGzut5rBy0he1fWzeROoz1hX7_AKkTokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DASame key as URL-safe Base64 without padding

The last two rows are the same 32 bytes in two Base64 spellings, so both give the same Base58.

Building an IPFS CIDv0 from a SHA-256 digest

A CIDv0 is Base58 of a multihash: the bytes 12 (SHA-256) and 20 (32 bytes long), then the digest. Many tools print a SHA-256 digest as Base64, and converting that alone does not give a Qm… string:

BytesBase64Base58
Digest onlyJiqGtnblhp7dXRrfj/0B1inDFUv96uz8jPoNkOCILYo=3Zz6yE7jDUVDb6doCEWrK58or4X2TmTLBiJeyWY4NHvq
12 20 + digestEiAmKoa2duWGnt1dGt+P/QHWKcMVS/3q7PyM+g2Q4Igtig==QmQudp5N7EzTxrBk3yESEKyEroMYNd7R22G2KWffwNZyzq

The EiA at the start of the second Base64 string is the encoded 12 20 header, so a Base64 multihash is easy to recognize. To add the header yourself, convert the digest with Base64 to hex, put 1220 in front, and encode the hex on the Base58 page with From set to Hex.

This only helps when you already have the digest IPFS computed. IPFS hashes a file’s UnixFS block, not the raw file, so running sha256sum on a file does not reproduce its CID.

Length: Base64 vs Base58

BytesBase64Base58 (random data)
162421 or 22
202826 to 28
324443 or 44
648887 or 88

Base64 length depends only on the byte count. Base58 length also depends on the value, which is why Solana addresses vary between 32 and 44 characters. Do not validate Base58 by exact length.

The same conversion in JavaScript

Node.js decodes Base64 natively; the Base58 half needs a BigInt:

const ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";

function base64ToBase58(b64) {
  const bytes = Buffer.from(b64, "base64");
  let n = BigInt("0x" + (bytes.toString("hex") || "0"));
  let out = "";
  while (n > 0n) {
    out = ALPHABET[Number(n % 58n)] + out;
    n /= 58n;
  }
  for (const b of bytes) {
    if (b !== 0) break;
    out = "1" + out;
  }
  return out;
}

base64ToBase58("Bt324ddloZPZy+FGzut5rBy0he1fWzeROoz1hX7/AKk=");
// 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'

Buffer.from(…, "base64") also accepts URL-safe input. The function relies on Node’s Buffer; Base64 in Node.js covers it in more detail.

FAQ

Can I convert Base64 to Base58 without decoding to bytes?

Not character by character. Base64 maps fixed 6-bit groups, while Base58 treats all the bytes as one number, so every converter, this page included, decodes the Base64 to bytes first and re-encodes those bytes.

Why is the Base58 result sometimes shorter than the Base64?

Base58 has no padding and leading zero bytes cost one character each. 32 bytes are always 44 Base64 characters (with =), but 43 or 44 in Base58, and only 32 when all bytes are zero.

Which Base58 alphabet does Solana use?

The Bitcoin alphabet, which is the default here. Flickr and Ripple are under Alphabet if you need them.

Why doesn't my Base58 output start with Qm?

Qm comes from the 2-byte multihash header 12 20. If your Base64 holds only the 32-byte SHA-256 digest, prepend those two bytes first, as described on this page.