Base58 Decoder / Encoder
Decode Base58 strings to text or hex bytes, or encode text/hex bytes to Base58 — using the Bitcoin alphabet.
Free online Base58 decoder and Base58 encoder — paste a Base58 string (like a Bitcoin address) to decode it to UTF-8 text or raw hex bytes, or encode your own text/hex into Base58. Uses the standard Bitcoin alphabet (no 0, O, I, or l) and correctly preserves leading zero bytes. No data is sent to a server.
Mode
Quick reference
- Hello
- →
9Ajdvzr - 00 byte
- → leading
1 - Alphabet
- no 0, O, I, l
- 58 symbols
- digits + letters
What is Base58 encoding?
A Base58 decoder converts a Base58-encoded string back into its original bytes — text, or arbitrary binary data shown as hex. Base58 is a binary-to-text encoding introduced by Bitcoin creator Satoshi Nakamoto that represents data using 58 printable characters instead of the 64 used by Base64. It exists specifically to be safer for humans to read, copy, and type by hand.
The Base58 alphabet excludes four visually ambiguous characters that Base64 includes: the digit 0 (zero) and the letter O (capital o) look alike in many fonts; the letter I (capital i) and the lowercase l (lowercase L) look alike too, and both can be confused with the digit 1. Removing all four leaves the Bitcoin alphabet:
123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz
That's 9 digits + 24 uppercase letters (minus I, O) + 25 lowercase letters (minus l) = 58 symbols. Base58 also avoids + and /, which can be interpreted specially by URLs and can break a double-click text selection — another reason it's the format of choice for values people paste into wallets and address bars: Bitcoin and other cryptocurrency addresses, Bitcoin private keys in WIF format, IPFS content identifiers (CIDs), Ripple/XRP addresses, and Flickr's short photo URL IDs.
How Base58 encoding works
Unlike Base64 (which maps fixed-size bit groups to characters), Base58 treats the entire input as one large number and repeatedly divides it by 58:
- Read the input bytes as one big-endian integer — the first byte is the most significant.
- Repeatedly divide by 58, taking the remainder each time. Each remainder (0–57) maps to one character in the alphabet.
- Reverse the digits — the last remainder computed is the first character of the output.
- Restore leading zero bytes. Since a number has no meaningful "leading zeros," each leading
0x00byte in the input is instead represented as a leading1character in the output — and reversed on decode.
That last step is the detail most hand-rolled implementations get wrong. This tool implements it directly with JavaScript's arbitrary-precision BigInt, so there's no length limit and no floating-point rounding error, and it was verified against the well-known Bitcoin P2PKH address test vector: version byte 0x00 + a 20-byte public key hash, Base58Check-encoded with its SHA-256d checksum, produces exactly 16UwLL9Risc3QfPqBUvKofHmBQ7wMtjvM.
How to decode Base58 to text or hex online
Set the mode to Decode, paste your Base58 string into the input, and choose whether you want the result shown as UTF-8 text or raw hex bytes. Hex is the right choice for cryptocurrency addresses and other binary payloads that aren't valid UTF-8 text; text mode is for values that were originally human-readable strings encoded to Base58. An invalid character — one of 0, O, I, l, or anything outside the alphabet — produces a clear error instead of a silently wrong result.
How to encode text or hex to Base58
Switch the mode to Encode, choose whether your input is UTF-8 text or hex bytes, and type or paste your value. Text input is converted to UTF-8 bytes first; hex input is parsed as pairs of hex digits (whitespace is ignored). The resulting Base58 string preserves leading zero bytes as leading 1 characters automatically.
How to encode and decode Base58 in JavaScript, Python & Node.js
JavaScript (browser, BigInt — no dependency)
const ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
function base58Encode(bytes) {
if (bytes.length === 0) return '';
let zeros = 0;
while (zeros < bytes.length && bytes[zeros] === 0) zeros++;
let num = 0n;
for (const b of bytes) num = (num << 8n) + BigInt(b);
let out = '';
while (num > 0n) { out = ALPHABET[Number(num % 58n)] + out; num /= 58n; }
return '1'.repeat(zeros) + out;
}
function base58Decode(str) {
let ones = 0;
while (ones < str.length && str[ones] === '1') ones++;
let num = 0n;
for (const c of str) {
const idx = ALPHABET.indexOf(c);
if (idx === -1) throw new Error('Invalid Base58 character: ' + c);
num = num * 58n + BigInt(idx);
}
const bytes = [];
while (num > 0n) { bytes.unshift(Number(num & 0xffn)); num >>= 8n; }
return new Uint8Array(Array(ones).fill(0).concat(bytes));
}
Python
# pip install base58
import base58
encoded = base58.b58encode(b'Hello, World!').decode() # 72k1xXWG59fYdzSNoA
decoded = base58.b58decode(encoded) # b'Hello, World!'
Node.js
// npm i bs58
const bs58 = require('bs58');
const encoded = bs58.encode(Buffer.from('Hello, World!'));
const decoded = Buffer.from(bs58.decode(encoded)).toString('utf8');
Working with other cryptocurrency or encoding formats? See the hex decoder, the Base 32 decoder for TOTP-style secrets, the Base 62 encoder for URL-safe IDs, or the Base64 converter for general-purpose encoding.
Base58 vs Base64 vs Base32 — which to use?
- Use Base58 for values a person needs to read, copy, or hand-type without risk of mixing up characters — cryptocurrency addresses, private keys, and content identifiers.
- Use Base32 for case-insensitive, human-entered secrets like TOTP/2FA codes.
- Use Base64 when size matters most and the value only ever travels between machines — data URLs, JWTs, API payloads.
None of these are encryption — all are fully reversible encodings with no secret key involved.
Frequently asked questions
123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz — all letters and digits except the visually ambiguous 0, O, I, and l. That's 62 minus 4 = 58 symbols.