Base64 vs Base58 Encoding
Base64 is one of the most popular encoding formats for representing data. Have some binary data? Base64 encodes it for convenient readability and parsing. Base58 is just another encoding format (with 58 characters instead of 64, and has gained popularity largely due to Bitcoin and other cryptocurrencies. Also, if you came here confused, encryption and encoding are not the same! Take a look at this article for more information on encryption vs encoding.
When it comes to data encoding, there is typically a trade-off made between:
- Human Readability: Do humans have a good idea of what is being represented at a glance?
- Efficient data compression: How many bytes are used to represent the same data, and how many characters are available?
Let’s rank Base58, Base64, and ASCII encoding against each other using these metrics!
First: A Note on Binary
All data is stored in a raw binary format on computers. These encoding formats (Base64, Base58, and ASCII) are just different ways of reading and writing binary data. For example, in Base64 the binary code 000000 represents the letter A, but in ASCII the binary 00000000 represents the NUL character.
ASCII Encoding

Human Readability Rank: 1st
Not all human language characters are possible using ASCII, but the most important ones are. ASCII is meant to be used in applications that need a simple way to represent Latin-based text, Arabic numerals, and formatting characters like newlines and spacing. ASCII is based on how typewriters worked in the pre-computer days.
Data Compression Rank: 3rd
Each character (typically) takes an entire byte (8 bits) of data. To represent the NUL character, we need to store 00000000, which is a lot of wasted zeros! It is worth noting that ASCII can work with only 7 bits, but because computers work in base-2, it is more simple to use a full byte.
You could also call ASCII Base128 because its alphabet is made up of 128 characters.
Base64

Human Readability Rank: 3rd
Base64 is designed to carry data stored in binary formats across channels that only reliably support text content
Base64 was essentially designed to trick computers… kind of. When we have binary but are only allowed to transport or display text, Base64 is a great choice.
Data Compression Rank: 2nd
Each character only takes 6 bits of data, and a padding character, =, is used to round to the nearest multiple of 4.
Base58

Human Readability Rank: 2nd
Satoshi Nakamoto, also the anonymous creator of Bitcoin, invented Base58. The goal was to get data compression levels comparable to that of Base64 but to make it easier for humans to read by eliminating characters that look similar to 0 (zero), O (capital o), I (capital i), l (lower case L). Alphanumeric characters + (plus) and / (slash) were also omitted for readability.
Data Compression Rank: 3rd
Very similar to that of Base64, but due to 6 fewer characters, not quite as efficient. Additionally, the parsing is slightly more awkward due to the base not being a power of 2.
Related Articles
Best Practices for Commenting Code
Oct 29, 2020 by Lane Wagner - Boot.dev co-founder and backend engineer
I often hear that we need more and better comments in the code we write. In my experience, we frequently need better comments, we rarely need more, and we sometimes need less. Before you crucify me for my sacrilege, let me explain by giving you some of the “rules of thumb” I use for deciding when I should add a comment to my code.
What Is Entropy In Cryptography?
Sep 28, 2020 by Lane Wagner - Boot.dev co-founder and backend engineer
If you’re familiar with the laws of thermodynamics, you may recognize the second law as the one that deals with entropy. In the realm of physics, entropy represents the degree of disorder in a system. Because systems tend to degrade over time, thermodynamic energy becomes less available to do mechanical work.
Guard Clauses - How to Clean up Conditionals
Sep 06, 2020 by Lane Wagner - Boot.dev co-founder and backend engineer
One of the first concepts new developers learn is the if/else statement. If/else statements are the most common way to execute conditional logic. However, complex and nested if/else statements can quickly become a cognitive burden and compromise the readability of a program.
Slow Is Smooth, Smooth Is Fast - 25% of Our Time Refactoring
Sep 01, 2020 by Lane Wagner - Boot.dev co-founder and backend engineer
My team has been spending less of our “free” time working on bugs and features from the backlog, and more time refactoring our code and tests. As a result, and perhaps somewhat counterintuitively, we’ve noticed a significant increase in our throughput of features and bug fixes.