DevTools

Hash Generator Online — MD5, SHA-256, SHA-512

Generate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes for any text, all side by side. Paste a known hash below to verify integrity.

Compare
MD5
SHA-1
SHA-256
SHA-384
SHA-512

What Is a Hash Function?

A cryptographic hash function is an algorithm that takes input data of arbitrary length and produces a fixed-length output called a digest or hash. The same input always produces the same digest (deterministic), and even a single character change produces a completely different output — a property known as the avalanche effect.

Hash functions are one-way: given a digest, it is computationally infeasible to recover the original input. This makes them fundamentally different from Base64 Converter encoding, which is a reversible transformation used only for transport safety. Common algorithms include MD5 (128-bit, 32 hex characters), SHA-1 (160-bit, 40 hex characters), SHA-256 (256-bit, 64 hex characters), and SHA-512 (512-bit, 128 hex characters).

MD5 and SHA-1 are no longer considered secure against collision attacks — an attacker can craft two different inputs that share the same digest. For security-sensitive uses such as digital signatures, certificate fingerprints, or password verification, SHA-256 or SHA-512 from the SHA-2 family should be used. MD5 remains practical for non-security tasks like cache keys, deduplication, and checksums where collision resistance is not required. This online hash generator supports all four algorithm families so you can compare outputs side by side.

Hash Algorithm Comparison

Using this hash generator requires no installation or account. Type or paste any string into the input field and all five digests — MD5, SHA-1, SHA-256, SHA-384, and SHA-512 — appear side by side. Computation runs entirely in your browser (Web Crypto API for the SHA family, crypto-js for MD5), so your text is never sent to a server.

Having every algorithm visible at once is the difference between this tool and most competitors: choose MD5 for fast checksums, SHA-1 for legacy compatibility, SHA-256 for general security work, SHA-384 or SHA-512 when a larger output space is required — no need to switch tabs. Paste a known hash into the Compare field and the matching row highlights green, letting you verify integrity against any algorithm without guessing which was used.

How to Generate a Hash Online

  1. 1
    Paste or type your text. Input appears in the text box. Short text updates instantly; longer input is debounced 150ms to keep typing smooth.
  2. 2
    Compare results live. All five hashes (MD5, SHA-1, SHA-256, SHA-384, SHA-512) are computed in parallel and shown side by side as you type.
  3. 3
    Copy or verify. Copy the hash you need with its row button, or paste a known hash into the Compare field — the matching row highlights green.
Code Examples
JavaScript (Web Crypto API)
async function sha256(text) {
  const encoder = new TextEncoder();
  const data = encoder.encode(text);
  const hashBuffer = await crypto.subtle.digest("SHA-256", data);
  const hashArray = Array.from(new Uint8Array(hashBuffer));
  return hashArray.map(b => b.toString(16).padStart(2, "0")).join("");
}

sha256("hello world").then(console.log);
// b94d27b9934d3e08a52e52d7da7dabfac484efe04294e576...
Python
import hashlib

text = "hello world"

print(hashlib.md5(text.encode()).hexdigest())
# 5eb63bbbe01eeed093cb22bb8f5acdc3

print(hashlib.sha1(text.encode()).hexdigest())
# 2aae6c69c27567b6d8e4d4d6d69b1d4d...

print(hashlib.sha256(text.encode()).hexdigest())
# b94d27b9934d3e08a52e52d7da7dabfac484efe04294e576...

print(hashlib.sha512(text.encode()).hexdigest())
Go
package main

import (
    "crypto/md5"
    "crypto/sha256"
    "fmt"
)

func main() {
    input := []byte("hello world")

    md5sum := md5.Sum(input)
    fmt.Printf("MD5:    %x\n", md5sum)

    sha := sha256.Sum256(input)
    fmt.Printf("SHA-256: %x\n", sha)
}
Bash
# SHA-256 (available on Linux and macOS)
echo -n "hello world" | sha256sum
# b94d27b9934d3e08a52e52d7da7dabfac484efe04294e576...

# MD5
echo -n "hello world" | md5sum

# SHA-512
echo -n "hello world" | sha512sum

# macOS uses shasum instead of sha256sum
echo -n "hello world" | shasum -a 256
Frequently Asked Questions

What is a hash function?

A cryptographic hash function takes input data of any size and produces a fixed-length output (called a digest). The process is deterministic and one-way — you cannot reverse a hash back to the original data.

What is the difference between MD5 and SHA-256?

MD5 produces a 128-bit (32-character) hash and is fast but considered insecure due to collision attacks. SHA-256 produces a 256-bit (64-character) hash and is currently considered secure.

Is MD5 still safe to use?

MD5 should not be used for security-critical applications like password hashing. However, it is still acceptable for checksums, cache keys, and deduplication where collision resistance is not critical.

Can I hash a file with this tool?

This tool currently hashes text input. For file hashing, you can use command-line tools like sha256sum (Linux/Mac) or CertUtil (Windows).

Related Developer Tools