Base64, hash and encoded address, do not mix them up
Published · Updated 2 min read
Three text transformations look alike: you get a string of strange characters, and people often think they do the same thing. Yet they serve three different purposes. Base64 writes data with safe characters, address encoding protects the special characters of a link, and the hash summarizes a content.
The same text, three treatments
Take a sentence: "Jardin du Vallon : atelier du 3 mai 2026 à 10 h (été)".
- Base64: SmFyZGluIGR1IFZhbGxvbiA6IGF0ZWxpZXIgZHUgMyBtYWkgMjAyNiDDoCAxMCBoICjDqXTDqSk=
- Encoded address: Jardin%20du%20Vallon%20%3A%20atelier%20du%203%20mai%202026%20%C3%A0%2010%20h%20(%C3%A9t%C3%A9)
- SHA-256 hash: a7acb57c7f0ee5e8f8ba13ea6186b720dab70c92499358b0b867e8e58458e2f9
Base64 protects nothing
Base64 turns data into letters, digits and a few signs that any system can carry without damaging them: an image in an email, a small file in a web page. But it is undone in a single operation, without a password. So it is not a way of hiding anything. The tool also offers a variant for addresses, Base64URL, which avoids awkward signs in a link and drops the final "=" sign.
Address encoding
In a link, some characters have a special meaning or are not allowed: the space, the colon, accented letters. The encoding replaces them with a code starting with the percent sign: the space becomes %20, and "à" becomes %C3%A0. Without it, a link containing free text risks breaking or pointing to the wrong place.
The hash
A hash is a summary: it cannot be undone, and you never get the text back from it. The same text always gives the same hash, and even a very slightly different text gives another one. That is what lets you check that a content has not changed.
How to choose
To carry data inside a text, use Base64. To put a text in a link, use address encoding. To check that a content has not changed, use the hash.
Where you meet these three forms
An image embedded in a page is often in Base64. A link containing a text with accents or spaces is encoded as an address. A hash accompanies the download of a file so that its integrity can be checked.
Check the result
Decode the result to get the original text back, except for the hash, which cannot be decoded. To compare whole files, see Check that a file has not changed using its hash.
Frequently asked questions
- Is Base64 encryption?
- No. It is undone in a single operation, without a password. It is used to carry data, not to hide it.
- What is address encoding for?
- It replaces the characters that cannot be put as they are in a link, such as the space, the colon or accented letters, with codes that start with the percent sign.
- Can you get a text back from its hash?
- No. A hash is a summary: it cannot be undone. The same text always gives the same hash.
- What is Base64URL?
- It is a variant of Base64 that avoids awkward signs in a link and drops the final "=" sign.
