tools / base58
base58/
Convert text or hex to and from Base58 using the Bitcoin alphabet. Each leading 00 byte becomes a leading 1.
Input
Base58
FAQ
Why does Base58 leave out 0, O, I and l, and what if decoding says a character isn't in the alphabet?
Base58 drops the digit 0, capital O, capital I and lowercase l because they are easy to mix up when read or copied by hand. The 58 characters left are 1 to 9, A to Z without I and O, and a to z without l. When decoding hits a character outside the alphabet, the tool tells you which character it is and where it sits. Check whether quotes, punctuation or invisible characters slipped in while copying; spaces and line breaks are ignored automatically. If the string really contains 0, O, I or l, it is probably not Base58 at all but Base64, hex or another encoding.
Base58 decoding says the result isn't valid UTF-8 text. What now?
The decoded bytes aren't UTF-8 text. Private keys, public key hashes and addresses are binary data to begin with. Switch the output format to hex to see the raw bytes. Text is always handled as UTF-8, so bytes written in GBK or another encoding can't be shown as text here; use a tool that supports that encoding.
What does the leading 1 in a Base58 result mean, and why does a leading 00 in hex become 1?
Base58 treats the whole byte string as one big integer and changes its base, so leading 00 bytes would vanish because they add nothing to the value. By convention each leading 00 byte is written as one leading 1 (the first character of the alphabet). For example, hex 0000010203 becomes 11Ldp, and the two leading 1s stand for the two 00 bytes. When decoding, every leading 1 turns back into a 00 byte; an input made only of 00 bytes ends up as just a run of 1s.
Can this decode Bitcoin addresses? What about the Base58Check checksum?
It decodes them to bytes but doesn't verify anything. Bitcoin addresses use Base58Check: a version byte, the data and a 4-byte checksum, joined together and then Base58-encoded. This tool only does plain Base58, so decoding gives you the full raw bytes without checking or stripping the checksum, and encoding doesn't add one. For example, 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa decodes (with hex output) to 25 bytes: a 1-byte version 00, a 20-byte hash and a 4-byte checksum at the end.
What's the difference between Base58 and Base64?
Base64 uses 64 characters (including + and /, with = padding at the end) and converts 3 bytes at a time, so it is fast and the output length is predictable. Base58 drops the look-alike characters as well as +, / and =, so a double-click selects the whole string and copying by hand is less error-prone. The cost is that it divides one big integer, so it gets slower as the input grows. That is why it is mostly used for short data such as addresses and keys, a few dozen bytes long. The two outputs are not interchangeable.
Why is my result different from another site or library?
Check three things. Alphabet: this tool uses the Bitcoin alphabet; Flickr's alphabet puts lowercase letters first and Ripple's uses yet another order, so the results differ. Input: text is encoded as UTF-8 exactly as typed, so one extra line break or space at the end changes the result. Input format: if you are encoding hex bytes, choose hex, otherwise 0a1b is treated as a four-character text. Hex input may use spaces, colons, commas or 0x prefixes as separators, and must have an even number of digits.
Is there a length limit for Base58 input?
Yes. Encoding accepts up to 32768 bytes and decoding up to 45000 characters; anything longer asks you to split it up. The amount of work in Base58 grows with the square of the length, so the limit keeps the page from freezing. A few KB or less is practically instant.
Is my input uploaded?
No. Encoding and decoding happen in your browser and nothing is sent to a server.