Base58 Encoder and Decoder

Convert text, hex bytes or small files to Base58 and back. Choose the Bitcoin, Flickr or Ripple alphabet, and optionally add or verify a Base58Check checksum.

Runs entirely in your browser. Nothing is uploaded.

How to use

  1. Choose Encode to turn text or bytes into Base58, or Decode to turn a Base58 string back into data.
  2. Pick the alphabet. Bitcoin is the default and is also the one used by IPFS and Solana.
  3. Type or paste your input. Switch the input to Hex if you have raw bytes such as a hash or a public key.
  4. Turn on Base58Check only if the string carries a 4-byte checksum, then copy or download the result.

What is Base58?

Base58 is a binary-to-text encoding created for Bitcoin. Its alphabet is the 62 digits and Latin letters minus four characters that are easy to confuse: 0 (zero), O (capital o), I (capital i) and l (lowercase L). It also has no +, / or =, so a Base58 string can be selected with a double click and placed in a URL without escaping.

Unlike Base64, Base58 does not cut the input into bit groups. The whole input is treated as one large number and written in base 58, so there is no padding and a change in one byte can alter many output characters. Leading zero bytes have no numeric value, so each one is written as the first character of the alphabet (1 in the Bitcoin alphabet) to keep it. The output is about 1.37 times the size of the input.

Where Base58 is used

  • Bitcoin. Legacy addresses and WIF private keys are Base58Check: Base58 with a version byte and a checksum.
  • IPFS. A version 0 content identifier (CIDv0) is the Base58 form of a SHA-256 multihash, which is why those CIDs are 46 characters long and start with Qm.
  • Solana. Public keys, account addresses and transaction signatures are written in plain Base58, without a checksum. A 32-byte key usually becomes 43 or 44 characters.
  • Flickr and the XRP Ledger. Flickr short links use the Flickr alphabet, and XRP addresses use the Ripple alphabet, which is why they begin with r.

To move between Base58 and raw bytes, use Base58 to Hex and Hex to Base58. For identifiers that only need to be alphanumeric, compare Base62.

Base58 alphabets

AlphabetCharacters, in order
Bitcoin123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz
Flickr123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ
Ripplerpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz

All three use the same 58 characters in a different order, so a string encoded with one alphabet decodes to different bytes, or fails, with another.

Base58 in code

# Python (pip install base58)
import base58
base58.b58encode(b'hello')      # b'Cn8eVZg'
base58.b58decode('Cn8eVZg')     # b'hello'

// JavaScript (npm install bs58)
import bs58 from 'bs58';
bs58.encode(new TextEncoder().encode('hello'));

Specification

Alphabet1-9 A-Z a-z without 0 O I l
Output sizeAbout 137% (big-number conversion)
PaddingNone (leading zero bytes become 1)
StandardBitcoin Base58
Case sensitiveYes

Examples

Input (UTF-8)Output
Hello, World!72k1xXWG59fYdzSNoA
Base64.isr1Nm3AS7ZcnN
你好2xuZUfBKa

Frequently asked questions

Why do leading zero bytes become 1?
Base58 converts the input to a single number, and leading zero bytes do not change its value. To keep them, each leading zero byte is written as the first alphabet character, which is 1 in the Bitcoin alphabet. That is why 32 zero bytes encode to a run of 32 ones.
Is Base58 case sensitive?

Yes. Uppercase and lowercase letters are different digits, so changing the case of a single character changes the decoded bytes or makes the string invalid.

What is the difference between Base58 and Base58Check?
Base58Check appends a 4-byte checksum (the start of a double SHA-256 hash) before encoding, so typing errors can be detected. Turn on the Base58Check option here, or see the Base58Check page for details.
Why is the input limited to about 20 KB?
Because the whole input is one big number, the work grows with the square of its length. Base58 is meant for keys, hashes and addresses, not files. For large data use Base64 or Base85.