Hash Generator — MD5, SHA-1, SHA-256 & SHA-512

Cryptographic hashes transform text, files, and secrets into unique, fixed-length digital fingerprints. This free developer tool calculates MD5, SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512 digests and keyed HMAC signatures directly in your browser. Real-time checksum verification lets you confirm file integrity and API webhook signatures without transmitting sensitive data across the network.

Free developer utility · runs 100% client-side

Cryptographic Hash Generator & Verifier

Generate MD5, SHA-1, SHA-256, SHA-512, SHA-384, and SHA-224 digests or HMAC signatures instantly with real-time checksum comparison.

  • MD5 & SHA-1 / SHA-2 Family
  • HMAC Keyed Signatures
  • Checksum Matcher & Verifier
  • Full UTF-8 Encoding
  • Zero Network Uploads

Input payload & configuration

Processed as UTF-8 binary bytes client-side. Nothing is sent to any server.

Characters: 0 Lines: 0 UTF-8 Bytes: 0

Compares pasted hash case-insensitively against all 6 algorithms instantly.

Integrity & cryptographic metrics

Enter or paste text above to compute digests, verify checksums, and inspect bit metrics.

Generated cryptographic hashes

SHA-256

256-bit · 64 hex · 32 bytes Recommended
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

MD5

128-bit · 32 hex · 16 bytes Legacy Checksum
d41d8cd98f00b204e9800998ecf8427e

SHA-512

512-bit · 128 hex · 64 bytes High Security
cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e

SHA-1

160-bit · 40 hex · 20 bytes Git / Legacy
da39a3ee5e6b4b0d3255bfef95601890afd80709

SHA-384

384-bit · 96 hex · 48 bytes Suite B Standard
38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b

SHA-224

224-bit · 56 hex · 28 bytes 3DES Parity
d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f

Security guidance & implementation notes

Recommended for Production: SHA-256 & SHA-512

SHA-256 and SHA-512 (FIPS PUB 180-4) remain completely collision-resistant with zero known practical vulnerabilities. Use SHA-256 for TLS certificates, modern API signatures, blockchain ledgers, and file downloads. On 64-bit hardware, SHA-512 often outperforms SHA-256 while providing 512-bit pre-image resistance.

Legacy Collision Warning: MD5 & SHA-1

MD5 and SHA-1 possess documented cryptographic collision attacks (Wang et al. 2004 for MD5; CWI/Google SHAttered 2017 for SHA-1). Never use MD5 or SHA-1 for digital signatures, SSL certificates, or authentication tokens. They remain safe exclusively as non-cryptographic checksums for accidental bit-flip detection, Git commit pointers, and Gravatar email lookups.

HMAC Authentication & Webhook Signatures

When an optional secret key is entered, this tool calculates RFC 2104 Keyed-Hash Message Authentication Codes. HMAC defends against length-extension vulnerabilities inherent in raw Merkle-Damgård constructions. Platforms such as Stripe, GitHub, Shopify, and Slack mandate HMAC-SHA256 for authenticating incoming webhooks.

Understanding Cryptographic Hash Functions

A cryptographic hash function is a deterministic mathematical algorithm that converts an arbitrary block of digital data into a fixed-size string of characters, commonly called a hash value, message digest, or checksum. Irrespective of whether the input is a single character, an API authentication token, or an entire disk image, the generated hash always retains an identical length.

Modern computing relies on cryptographic hashing across security protocols, operating system integrity checks, database indexing, and peer-to-peer file distribution. The three fundamental tenets that define a secure cryptographic hash function are:

  1. Pre-image Resistance (One-Way): It is computationally infeasible to reconstruct the original input plaintext from its generated hash digest. Given a hash output h, an attacker cannot reverse-engineer m such that hash(m) = h.
  2. Second Pre-image Resistance (Weak Collision Resistance): Given a specific input message m1, it is practically impossible to find a secondary distinct message m2 such that hash(m1) = hash(m2).
  3. Collision Resistance (Strong Collision Resistance): It is computationally infeasible to find any two arbitrary distinct inputs m1 and m2 that evaluate to the exact same hash digest.
  4. The Avalanche Effect: A minuscule alteration in the input payload—such as flipping a single binary bit or changing a lowercase letter to an uppercase letter—causes a dramatic, pseudorandom transformation in the resulting digest, altering upwards of 50% of the output bits.

Comparison of Cryptographic Hash Algorithms

Different cryptographic hash algorithms vary in architectural block size, output bit length, mathematical rounds, and vulnerability to cryptanalysis. The table below outlines the core properties of the algorithms generated by this tool:

Algorithm Digest Size (Bits) Hex Length Word Size Security Status Recommended Modern Use Case
SHA-256 256 bits 64 characters 32-bit Secure TLS certificates, Bitcoin, Docker image digests, Linux packages
SHA-512 512 bits 128 characters 64-bit Secure High-security digital signatures, HMAC webhooks, 64-bit CPU caching
SHA-384 384 bits 96 characters 64-bit Secure US NSA Suite B / CNSA top-secret government cryptography
SHA-224 224 bits 56 characters 32-bit Secure Two-key Triple DES (3DES) key matching and legacy parity
SHA-1 160 bits 40 characters 32-bit Vulnerable (Collisions) Git commit trees, legacy torrent verification, non-crypto lookups
MD5 128 bits 32 characters 32-bit Broken (Collisions) Accidental corruption checks, Gravatar URLs, ETag caching

The Secure Hash Algorithm (SHA) Family

The Secure Hash Algorithm family was published by the National Institute of Standards and Technology (NIST) as a U.S. Federal Information Processing Standard (FIPS). Over thirty years, the standard has evolved through multiple generations to counter increasing supercomputing capabilities and advanced mathematical cryptanalysis.

SHA-1: Architecture and Retirement

Published in 1995 as FIPS PUB 180-1, SHA-1 generates a 160-bit (20-byte) message digest using an 80-round Merkle-Damgård iterative structure. While SHA-1 was the dominant standard for SSL certificates and Git version control for two decades, theoretical weaknesses were revealed in 2005 by researchers Xiaoyun Wang, Yiqun Lisa Yin, and Hongbo Yu. In 2017, researchers from CWI Amsterdam and Google announced SHAttered, producing the first practical SHA-1 collision between two distinct PDF documents. Consequently, NIST formally deprecated SHA-1 for digital signatures and browser vendors eliminated SHA-1 support from TLS certificates.

SHA-2: SHA-256, SHA-384, and SHA-512

Recognizing the eventual limits of 160-bit digests, NIST published the SHA-2 family in FIPS PUB 180-2. SHA-2 introduces novel bitwise rotation constants, enhanced non-linear functions (Ch and Maj), and expanded internal states. SHA-2 is bifurcated into two primary architectural families:

  • 32-bit Architecture (SHA-256 and SHA-224): Operates on 32-bit words across 64 computation rounds. SHA-256 provides 128 bits of security against collision attacks and 256 bits against pre-image attacks. It is universally supported across hardware cryptographic accelerators.
  • 64-bit Architecture (SHA-512 and SHA-384): Operates on 64-bit integer words across 80 computation rounds. On modern 64-bit microprocessors (x86-64 and ARM64), SHA-512 often executes faster than SHA-256 because 64-bit registers process twice as much data per clock cycle. SHA-384 is derived by truncating the SHA-512 output state using distinct initial vector constants.

MD5: Fast Checksum Utility vs Cryptographic Vulnerability

Designed by Ronald Rivest in 1991 to succeed MD4, the Message Digest 5 (MD5) algorithm produces a 128-bit (16-byte) hash value. MD5 processes 512-bit message blocks through four rounds of 16 operations each, utilizing sine-based integer constants.

Why MD5 Collisions Occur

In 2004, research teams demonstrated that MD5's internal compression function fails collision resistance. Today, a collision attack on MD5 can be executed on a standard consumer laptop in under a second using chosen-prefix techniques. Because an adversary can forge two distinct files with identical MD5 checksums, MD5 must never be used for digital certificates, software binary signing, password verification, or document tamper detection.

Legitimate Non-Cryptographic Uses of MD5

Despite its cryptographic death, MD5 remains one of the most widely used algorithms in software engineering for tasks that do not involve an active adversary:

  • Accidental File Corruption Verification: Rapidly detecting flipped bits, incomplete network downloads, or damaged disk sectors.
  • Web Application Cache Keys: Generating short 32-character cache keys from long SQL queries, HTML fragments, or URL query parameters.
  • Gravatar Identifiers: Constructing profile image URLs by taking the MD5 hash of an email address (e.g., gravatar.com/avatar/{md5_email}).
  • HTTP ETag Headers: Generating entity tags for web server static asset caching and 304 Not Modified responses.
  • Database Sharding & Partitioning: Evenly distributing data records across distributed database clusters using modulo arithmetic on the hash output.

Keyed-Hash Message Authentication Codes (HMAC)

When transmitting data between distributed systems—such as cloud webhooks, payment notifications, and microservices—generating a raw hash of the message is insufficient because anyone can intercept the payload, alter the content, recompute the hash, and forward the forged request. Keyed-Hash Message Authentication Codes (HMAC), standardized in RFC 2104, solve this problem by incorporating a secret cryptographic key shared exclusively between the sender and receiver.

The HMAC Construction

HMAC is defined mathematically as:

HMAC(K, m) = H((K' ⊕ opad) || H((K' ⊕ ipad) || m))

Where H is the underlying cryptographic hash function (such as SHA-256), K' is the normalized secret key padded to the cipher's block size (64 bytes for SHA-256, 128 bytes for SHA-512), ipad is the byte 0x36 repeated, opad is the byte 0x5C repeated, and || denotes byte concatenation.

Defense Against Length-Extension Attacks

A severe architectural flaw in standard Merkle-Damgård hash functions (including MD5, SHA-1, SHA-256, and SHA-512) is the length-extension vulnerability. If a system constructs a naive signature via hash(secret || message), an attacker who knows only the message and its resulting hash can append arbitrary malicious data to the payload and compute the valid signature for the extended message—without ever discovering the secret key. HMAC's nested two-pass design completely neutralizes length-extension attacks, making it the required standard for API webhook signatures across Stripe, GitHub, Shopify, and AWS.

Best Practices for Password Storage

One of the most persistent security mistakes in web development is storing user passwords using raw cryptographic hash functions like MD5, SHA-1, or plain SHA-256. While these functions are one-way, they were intentionally engineered to be extremely fast in hardware.

Why Raw Hashes Fail for Passwords

A modern consumer graphics card (GPU) can evaluate tens of billions of SHA-256 hashes per second. Attackers employ pre-computed lookup tables (rainbow tables) and brute-force GPU clusters (such as Hashcat) to reverse unsalted or single-iteration hashes of common passwords in milliseconds.

The Modern Password Hashing Standard

For authentication and password storage, systems must use dedicated, memory-hard key derivation functions designed to be computationally expensive and resistant to ASIC/GPU parallelization:

  1. Argon2id (Winner of the Password Hashing Competition): The recommended modern standard. Combines memory-hardness to defeat GPU cracking with data-independent memory access to prevent side-channel timing attacks.
  2. bcrypt: A battle-tested Blowfish-based adaptive hashing algorithm with configurable work factors that scale alongside CPU hardware improvements.
  3. scrypt: Specifically architected to require substantial RAM, preventing attackers from building cheap custom FPGA or ASIC cracking hardware.
  4. PBKDF2 (Password-Based Key Derivation Function 2): A FIPS-compliant standard applying thousands of HMAC iterations (recommended ≥ 600,000 iterations with HMAC-SHA256).

Frequently Asked Questions

Can you reverse or decrypt an MD5 or SHA-256 hash?

No. Cryptographic hashes are one-way mathematical compression functions, not ciphers. When a string is hashed, variable-length information is compressed into fixed-size bits, causing irrecoverable information loss. There is no mathematical key or decryption algorithm that can reverse a hash back to its source text. Attackers can only discover the original text by computing forward hashes of guesses until a match is found (dictionary and brute-force attacks).

What is the difference between encoding and hashing?

Encoding (such as Base64 or URL encoding) is a reversible, two-way transformation designed to ensure data is safely transmitted across protocols without data corruption. Any encoded string can be decoded back to its exact original form without a password or key. In contrast, hashing is a permanent, irreversible one-way digest designed to verify integrity and authenticity.

Why does SHA-512 sometimes compute faster than SHA-256?

SHA-256 operates on 32-bit words across 64 rounds, while SHA-512 operates on 64-bit words across 80 rounds. On modern 64-bit microprocessors (x86-64 Intel/AMD and ARM64 Apple Silicon), the CPU registers natively execute 64-bit integer arithmetic. Processing 64-bit words means SHA-512 consumes twice as much message data per instruction, allowing it to achieve higher throughput on large inputs than SHA-256 on 64-bit systems.

Are my inputs, files, or secret keys sent to a server?

No. This tool is built entirely in vanilla client-side JavaScript. All hashing calculations, UTF-8 byte conversions, HMAC signatures, and checksum comparisons execute locally inside your web browser engine. No network packets, cookies, or tracking payloads are transmitted to any external server.

How does checksum verification work when downloading software?

Software distributors publish checksum files (such as SHA256SUMS) alongside installation packages. When you download a file, you calculate its hash locally using a terminal command (like sha256sum file.iso or CertUtil -hashfile file.iso SHA256 on Windows) and paste the result into the Checksum Matcher field. If the hashes match character-for-character, you have mathematical proof that your downloaded file is identical to the author's original release and has not been corrupted by network packet drops or modified by a man-in-the-middle attacker.

What is a timing attack in webhook verification?

When an application compares an incoming webhook signature against a calculated HMAC signature using standard string equality (signature == expected), standard programming languages stop comparison at the first mismatched character. Attackers can measure tiny sub-millisecond network round-trip differences to guess the signature character-by-character. To prevent timing attacks, always use constant-time comparison functions (such as crypto.timingSafeEqual() in Node.js or hash_equals() in PHP).

Related Developer & Data Utilities

Explore sibling client-side developer and data processing utilities available on our platform: