Encoding vs encryption vs hashing: what is the difference?
Published by InstantToolDeck · Updated November 2026
Base64, AES and SHA-256 all turn readable data into something that looks scrambled, so they are easy to confuse. They solve very different problems, and mixing them up leads to real security mistakes.
Encoding: changing the format
Encoding converts data into another representation so it can be stored or transmitted safely. It involves no secret, and anyone can reverse it. Examples: Base64, URL encoding and hexadecimal. Base64 lets binary data such as an image travel inside JSON or email. URL encoding replaces unsafe characters such as spaces with codes like %20. Encoding is not security. If a secret is only Base64 encoded, it is effectively public.
Try it with the Base64 tool or the URL encoder.
Encryption: hiding data with a key
Encryption scrambles data so only someone with the right key can read it. It is reversible, but only with the key. Examples: AES for files and storage, and RSA or the elliptic-curve methods used in HTTPS. Use encryption when you need to get the original data back later, such as protecting stored documents or messages in transit.
Hashing: a one-way fingerprint
A hash function turns any input into a fixed-length fingerprint. The same input always gives the same hash, a tiny change produces a completely different one, and you cannot work backwards from the hash to the input. Examples: SHA-256 and SHA-512. Hashes are used to check file integrity, detect changes and store passwords (with the right algorithms). Create one with the hash generator.
Quick comparison
| Reversible? | Needs a key? | Purpose | |
|---|---|---|---|
| Encoding | Yes, by anyone | No | Compatibility and transport |
| Encryption | Yes, with the key | Yes | Confidentiality |
| Hashing | No | No | Integrity and fingerprints |
Common mistakes
- Storing passwords with Base64 or plain SHA-256. Use a slow, salted algorithm designed for passwords, such as bcrypt, scrypt or Argon2.
- Calling Base64 “encryption”. It provides no protection.
- Using MD5 or SHA-1 for security. Both are broken for security purposes, though they remain in use for non-security checksums.
- Putting secrets inside a JWT payload. A JSON Web Token’s contents are only Base64 encoded, so anyone can read them with a JWT decoder. The signature proves it was not altered, but it does not hide the data.
Which should you use?
Need compatibility? Encode. Need secrecy? Encrypt. Need to check that something has not changed? Hash. Need to store a password? Use a dedicated password hash.
Frequently asked questions
Is Base64 encryption?
No. Anyone can decode Base64 without a key. It is only a way of writing data.
Can a hash be decrypted?
No. Hashing is one-way, although weak or common inputs can be guessed by trying many candidates.
Which hash should I use for file checksums?
SHA-256 is a good default.