Online MD5 Hash Calculator

Other algorithm calculators

MD2 MD4 MD5 SHA1 SHA224 SHA256 SHA384 SHA512/224 SHA512/256 SHA512 SHA3-224 SHA3-256 SHA3-384 SHA3-512 RIPEMD128 RIPEMD160 RIPEMD256 RIPEMD320 WHIRLPOOL TIGER128,3 TIGER160,3 TIGER192,3 TIGER128,4 TIGER160,4 TIGER192,4 SNEFRU SNEFRU256 GOST GOST-CRYPTO ADLER32 CRC32 CRC32B CRC32C FNV132 FNV1A32 FNV164 FNV1A64 JOAAT MURMUR3A MURMUR3C MURMUR3F XXH32 XXH64 XXH3 XXH128 HAVAL128,3 HAVAL160,3 HAVAL192,3 HAVAL224,3 HAVAL256,3 HAVAL128,4 HAVAL160,4 HAVAL192,4 HAVAL224,4 HAVAL256,4 HAVAL128,5 HAVAL160,5 HAVAL192,5 HAVAL224,5 HAVAL256,5

Your last 10 encodings

AlgorithmStringHash
sha512-2241q2w3e94c3d9d609a16f97be8956e60c66a8641d1d1c8853e31f780c8ad4bb

Usage FAQ

Usage from Address Bar

Access this page directly from your browser's address bar. Enter the string you need to encode with an algorithm according to the following schema: https://md5calc.com/hash/<ALGORITHM>/<PHRASE> For example, to visit the page with the hash of "hello world", simply go to: https://md5calc.com/hash/md5/hello+world Another cool feature is that you can specify "json" or "plain" mode in the URL to get only the HASH in the response. Schema of this feature: https://md5calc.com/hash/<ALGORITHM>.<OUTPUT:plain|json>/<PHRASE> Example: https://md5calc.com/hash/md5.json/hello+world Will output only: "5eb63bbbe01eeed093cb22bb8f5acdc3"

If you have a string containing complex URL-encoded characters, you can send it directly via parameters to avoid processing by our URL parser. Use:
str - for string to encode
algo - for algorithm
output - for output type (empty, "json" or "plain")
https://md5calc.com/hash?algo=<ALGORITHM>&str=<PHRASE>&output=<OUTPUT:plain|json> https://md5calc.com/hash?algo=md5&str=hello%0Aworld https://md5calc.com/hash/md5?str=hello%0Aworld

Usage from JavaScript

We have removed the CORS restriction, so you can access the hash calculator directly in your JavaScript applications via AJAX.

Example:

var toEncode = 'hello world';
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
console.log('JSON of "'+toEncode+'" is "'+JSON.parse(xhr.response)+'"');
};
};
xhr.open('GET', 'https://md5calc.com/hash/md5.json/'+encodeURIComponent(toEncode), true);
xhr.send();
Will output: JSON of "hello world" is "5eb63bbbe01eeed093cb22bb8f5acdc3"

Usage from PHP

You can access this function directly in your applications.

PHP Example: <?php
$str = 'hello world';
$url ='https://md5calc.com/hash/md5.plain/'.urlencode($str);
$md5hash = file_get_contents($url);
echo 'Hash of "'.$str.'" is "'.$md5hash.'"';
Will output: Hash of "hello world" is "5eb63bbbe01eeed093cb22bb8f5acdc3"

Chains of algorithms

In some cases, you may need to encode a string using two or more algorithms. For these cases, we have introduced chains of algorithms. For example, if you need to encode a string according to this schema: md5(sha512(sha1('hello world'))) you can do this by connecting algorithms with a double dash: https://md5calc.com/hash/md5--sha512--sha1/hello+world If you do this in your address bar, you can also use a semicolon instead of a double dash. https://md5calc.com/hash/md5;sha512;sha1/hello+world Note that the semicolon should be encoded in the URL, so if you are not using a browser, you should use '%3B' instead: https://md5calc.com/hash/md5%3Bsha512%3Bsha1/hello+world This approach can also be used with "plain" and "json" modes: https://md5calc.com/hash/md5--sha512--sha1.plain/hello+world https://md5calc.com/hash/md5;sha512;sha1.json/hello+world

You can also use the special chain item "b64d" or "base64decode" to perform a Base64 decode. This helps when hashing non-printable characters. Example: https://md5calc.com/hash/md5.plain/hello+world https://md5calc.com/hash/b64d--md5.plain/aGVsbG8gd29ybGQ= will be the same: 5eb63bbbe01eeed093cb22bb8f5acdc3

Carriage Return and Line Feed characters

Currently, our text editor doesn't have the functionality to determine which of those characters you want to keep in the string. This issue arises because browsers normalize all line endings to the "CRLF" ("\r\n") format according to the HTML specification. This means that if you paste a string from the clipboard:
"hello\nworld" and press "Encode", your browser will convert it to "hello\r\nworld" and only after this will your browser send the form to us. As a result, we will show you the hash of: "hello\r\nworld" but not "hello\nworld".

You can avoid this by encoding the string to "Base64" on your side and using the "Chains of algorithms" described above.

Example 1: Hash of a string with only a Line Feed (LF) character Text: hello\nworld
Text encoded to BASE64: aGVsbG8Kd29ybGQ=
URL: https://md5calc.com/hash/b64d--md5.plain/aGVsbG8Kd29ybGQ=
RESULT: 9195d0beb2a889e1be05ed6bb1954837

Example 2: Hash of a string with Carriage Return (CR) and Line Feed (LF) characters. This is the result you will get if you use an editor with CR, LF, or CRLF symbols.
Text: hello\r\nworld
Text encoded to BASE64: aGVsbG8NCndvcmxk
URL: https://md5calc.com/hash/b64d--md5.plain/aGVsbG8NCndvcmxk
RESULT: 6a4316b18e6162cf9fcfa435c8eb74c1

How to calculate md5 hash in PHP with hash function

Since version 5.1.2, PHP contains the hash() function that you can use to get md5 hash from strings.

<?php
    $str = '¡Hola!';
    $hash = hash('md5', $str, false);
    echo '<pre>';
    echo $str.PHP_EOL
         .' &rarr; '.$hash.PHP_EOL
    ;
    echo '</pre>';

How to calculate md5 hash in Node.js

Node.js includes the built-in crypto module, which lets you compute md5 hashes from strings or buffers without installing external packages.

    const crypto = require('crypto');
     const str = '¡Hola!';
    const hash = crypto.createHash('md5').update(str, 'utf8').digest('hex');
    console.log(`${str} -> ${hash}`);

How to calculate md5 hash in Python

Python provides the standard library hashlib module. Always encode strings to utf-8 bytes before hashing.

    import hashlib
     text = "¡Hola!"
    digest = hashlib.md5(text.encode("utf-8")).hexdigest()
    print(f"{text} -> {digest}")

How to calculate MD5 hash in PHP with md5 function

md5() function - the most popular way to get MD5 hash in PHP

<?php
    $str = '¡Hola!';
    $hash = md5($str);
    echo '<pre>';
    echo $str.PHP_EOL
         .' &rarr; '.$hash.PHP_EOL
    ;
    echo '</pre>';

How to calculate MD5 hash in JavaScript

JavaScript does not have a built-in function to calculate MD5 hash, so you need to use an external library. For example: emn178/js-md5

<script src="https://cdn.jsdelivr.net/npm/js-md5@0.7.3/src/md5.js"></script>
<script>
    var str = '¡Hola!';
    var hash = md5(str);
    console.log(str);
    console.log('-> ' + hash);
</script>

How to calculate MD5 hash in Java

To calculate MD5 hash in Java, use the "MessageDigest" class from the "java.security" namespace.

String str = "¡Hola!";
 java.security.MessageDigest md = java.security.MessageDigest.getInstance("MD5");
md.update(str.getBytes());
 byte byteData[] = md.digest();
 //convert the byte to hex format
StringBuffer sb = new StringBuffer();
for (int i = 0; i < byteData.length; i++) {
    sb.append(Integer.toString((byteData[i] & 0xff) + 0x100, 16).substring(1));
}
 System.out.println(str + "\n-> " + sb.toString());

How to calculate MD5 hash in C#

The easiest way to get an MD5 hash in C# is to use the "MD5" class from the "System.Security.Cryptography" namespace.

string str = @"¡Hola!";
using (System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create())
{
    byte[] inputBytes = new System.Text.UTF8Encoding().GetBytes(str);
    byte[] hashBytes = md5.ComputeHash(inputBytes);
     // Convert the byte array to hexadecimal string
    System.Text.StringBuilder sb = new System.Text.StringBuilder();
    for (int i = 0; i < hashBytes.Length; i++)
    {
        sb.Append(hashBytes[i].ToString("X2"));
    }
     Console.WriteLine(sb.ToString());
}

How to calculate MD5 hash in Go

To calculate an MD5 hash in Go, use the "md5" package from the "crypto" namespace.

package main
 import (
    "crypto/md5"
    "fmt"
)
 func main() {
    data := []byte("¡Hola!")
    fmt.Printf("%x", md5.Sum(data))
}
Please read the privacy policy (agreement of the cookies usage, other websites embedded content, etc.). If you continue to use the site, we will assume that you agree with our privacy policy.
OkPrivacy Policy