MD5 hash generator

Get the MD5 hash of any text as you type, for checksums and legacy systems.

loading MD5 hash generator
About this tool

What is an MD5 hash?

MD5 turns any text into a 128-bit fingerprint, written as 32 hexadecimal characters. It dates from 1991 and is still everywhere: file checksums on download pages, ETags, cache keys, deduplication, the Content-MD5 header and countless legacy databases. It is fast and short, which is exactly what those uses need.

It is also broken as a security tool. Since 2004, researchers can build two different inputs with the same MD5, and in 2012 the Flame malware used such a collision to fake a Microsoft code-signing certificate. So MD5 is fine to detect accidental corruption, and wrong anywhere an attacker might choose the input: passwords, signatures, certificates, integrity of files from untrusted sources. For those, use SHA-256 or, for passwords, Argon2id.

This page opens the hash generator with MD5 as the focus. The text is encoded as UTF-8 and hashed in your browser; nothing is uploaded.

How to generate an MD5 hash

  1. Type or paste the text into Text to hash.
  2. The MD5 row, first under Cryptographic hashes, updates as you type.
  3. Pick Digest encoding: hex for most uses, Base64 for headers like Content-MD5.
  4. Click the copy button at the end of the row.

Examples

A short word

hello
5d41402abc4b2a76b9719d911017c592

Why MD5 does not protect passwords

password
5f4dcc3b5aa765d61d8327deb882cf99

This hash appears in every public list of leaked passwords. Anyone holding an unsalted MD5 password table recovers common passwords by lookup, in no time.

Content-MD5 header (Base64)

With Digest encoding set to Base64, hello becomes XUFAKrxLKna5cZ2REBfFkg==, the format storage APIs expect in a Content-MD5 header.

Common errors

  • The hash does not match the one on a download page: that hash is of the file's bytes, not of text. Run md5sum file (Linux) or md5 file (macOS) on the downloaded file.
  • Different hash than another tool for the same text: a trailing newline or space, or a different character encoding. echo adds a newline; use printf '%s'.
  • Uppercase versus lowercase: 5D41… and 5d41… are the same hash; compare them case-insensitively.

FAQ

Can an MD5 hash be decrypted?

No, but it can be guessed. Hashing has no key to undo it; "MD5 decrypt" sites look the hash up in huge tables of known inputs. Anything short or common is found instantly.

Is MD5 still safe to use?

For checksums against accidental damage, caching and deduplication, yes. For anything security-related, no: collisions are cheap to produce. Prefer SHA-256, or HMAC to authenticate messages.

Why does Web Crypto not offer MD5?

Browsers left it out on purpose because it is insecure. In JavaScript you need Node.js crypto or a library; this page uses a small pure-JavaScript implementation.

How to generate MD5 in code

JavaScript

In Node.js:

import { createHash } from 'node:crypto';
createHash('md5').update('hello', 'utf8').digest('hex'); // '5d41402abc4b2a76b9719d911017c592'

Python

import hashlib
hashlib.md5("hello".encode("utf-8")).hexdigest()

Go

sum := md5.Sum([]byte("hello"))
fmt.Println(hex.EncodeToString(sum[:]))

Bash

printf '%s' hello | md5sum   # Linux
md5 -q -s hello              # macOS
Report a problem