Upload a file
  1. base64hub
  2. Keys & hashes
  3. MD5 hash in Base64

MD5 to Base64

Drop a file or type text to get its MD5 digest as 24-character Base64, the form Content-MD5 headers and cloud storage APIs expect, plus the familiar 32-character hex.

Free no sign-up, no limits Local nothing uploaded Large files MD5 streamed in 8 MB chunks Updated Oct 27, 2026

Processed in your browser. This page cannot send your data anywhere – how we know

How to get an MD5 hash in Base64

  1. MD5 is preselected under Algorithm.
  2. For a file, switch Input to File and drop it, or several files at once; each gets its own result. Files above 200 MB are read in 8 MB chunks with a progress percentage.
  3. For text, keep Input on Text and type or paste. Input is lets you hash hex or Base64 data as raw bytes instead of as UTF-8 text.
  4. Copy the Base64 value for headers and APIs, or Hex to compare with md5sum output. Both describe the same 16 bytes.

The tool shows a short warning that MD5 is unfit for security purposes, which is accurate and does not affect checksums.

Hex or Base64: the same 16 bytes

InputMD5 (hex)MD5 (Base64)
emptyd41d8cd98f00b204e9800998ecf8427e1B2M2Y8AsgTpgAmY7PhCfg==
hello5d41402abc4b2a76b9719d911017c592XUFAKrxLKna5cZ2REBfFkg==
The quick brown fox jumps over the lazy dog9e107d9d372bb6826bd81d3542a419d6nhB9nTcrtoJr2B01QqQZ1g==

The most common mistake with Content-MD5 is Base64-encoding the hex text. For the fox sentence that produces OWUxMDdkOWQzNzJiYjY4MjZiZDgxZDM1NDJhNDE5ZDY=, 44 characters that no server will accept. The length tells you at a glance: 24 characters is right, 44 is the hex encoded by mistake.

Where Base64 MD5 is expected

  • Content-MD5 request headers (RFC 1864). Amazon S3 checks it on uploads, and Azure Blob Storage does too, returning an error when the body does not match.
  • Google Cloud Storage reports an object’s md5Hash in Base64, and gsutil hash prints Base64 unless you pass -h for hex.
  • Azure Blob properties store Content-MD5 in Base64 as well.
  • Older APIs and email systems that adopted the header before SHA-based checksums existed.

Other places stay with hex: md5sum and most download pages, and the ETag of a single-part S3 upload, which is the hex MD5 in quotes. Multipart S3 ETags end in - and a part count and are not an MD5 of the whole file at all, so they will never match this tool’s result.

MD5 to Base64 on the command line and in code

openssl md5 -binary file.bin | base64
md5sum file.bin | cut -d' ' -f1 | xxd -r -p | base64
import base64, hashlib

with open("file.bin", "rb") as f:
    digest = hashlib.file_digest(f, "md5").digest()
print(base64.b64encode(digest).decode())

hashlib.file_digest needs Python 3.11 or newer; on older versions read the file in chunks and call update(). In Node.js, crypto.createHash("md5").update(buffer).digest("base64") gives the Base64 form directly. If a newer API offers a SHA-256 checksum instead, prefer it; SHA-256 to Base64 produces those values the same way. More snippets live on the OpenSSL and Python pages.

FAQ

What is the Content-MD5 header?

An HTTP header from RFC 1864 that carries the Base64 of the 16-byte MD5 digest of the body. Storage services such as Amazon S3 and Azure Blob Storage use it to reject uploads that were corrupted in transit.

Why is my Base64 MD5 44 characters long?

You encoded the 32-character hex string instead of the 16 raw bytes. A correct MD5 in Base64 is always 24 characters ending in ==. Hash with a binary output (-binary in OpenSSL, .digest() in Python) before encoding.

How do I convert an MD5 hex checksum to Base64?

Decode the hex to bytes and Base64-encode them: 9e107d9d372bb6826bd81d3542a419d6 becomes nhB9nTcrtoJr2B01QqQZ1g==. The hex to Base64 converter does it in one paste.

Is MD5 still safe to use?

For detecting accidental corruption, yes. For anything an attacker could influence, no: MD5 collisions can be produced on a laptop, so two different files can share a hash. Use SHA-256 for integrity against tampering and a password hash such as Argon2 or bcrypt for passwords.