Skip to main content

SHA-2 Family Generator

Generate SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA-512/256 hashes

Generate SHA-2 family hashes (SHA-256, SHA-512, SHA-224, SHA-384). NIST-standard cryptographic hashing for digital signatures, blockchain, and TLS certificates.


How to generate a SHA-2 family hash?

Generating a SHA-2 family hash takes just a few steps: Type or paste your text into the input box, or upload a file if you need to compute its hash digest. Select the SHA variant you need from the dropdown menu. SHA-256 is the default and recommended choice for most applications. SHA-512 is faster on 64-bit systems. SHA-1 is included for legacy compatibility but should not be used for new security-sensitive projects. Click Generate to compute the hash. The result appears instantly in the output box as a hexadecimal string. Copy it and use it wherever needed — whether that's verifying a downloaded file, signing a commit in Git, or generating a unique identifier for a record in your database.

Related Tools

You May Also Need

SHA-2 variant comparison and when to use each

SHA-2 includes seven standardized variants defined in FIPS 180-4: SHA-224 (224-bit), SHA-256 (256-bit), SHA-384 (384-bit), SHA-512 (512-bit), SHA-512/224 (truncated SHA-512), SHA-512/256 (truncated SHA-512), and SHA-1 (historical, 160-bit). SHA-256 is the workhorse — used in Bitcoin mining, TLS certificates, Git commits, and PGP signatures. SHA-512 runs faster than SHA-256 on 64-bit architectures because it operates on 64-bit words rather than 32-bit words, making it ideal for servers and modern desktops. SHA-384 is simply SHA-512 truncated to 384 bits and is used in TLS suites like ECDHE-RSA-AES256-GCM-SHA384. SHA-512/224 and SHA-512/256 were added in 2013 (FIPS 180-4) to provide truncated outputs from the SHA-512 compression function without the security concerns of truncating SHA-256. SHA-1 remains in the family for backward compatibility with existing systems but has been deprecated since 2017 following practical collision attacks demonstrated by CWI Amsterdam and Google.

SHA-1 deprecation timeline and collision attacks

SHA-1's security collapsed over several years. In 2005, Wang et al. demonstrated theoretical collision attacks reducing SHA-1's security below 80 bits. In 2017, the SHAttered attack produced the first practical collision: two PDF files with identical SHA-1 hashes but completely different content. Google and CWI Amsterdam achieved this in 6,500 CPU years and 110 GPU years — expensive but feasible for well-funded attackers. Following this, Chrome, Firefox, Safari, and Edge all began rejecting SHA-1 SSL certificates in 2018. Microsoft removed SHA-1 code-signing trust in Windows 10 in January 2020. Git deprecated SHA-1 for object hashing in 2022, migrating to SHA-256. Despite this, SHA-1 persists in legacy systems — TLS 1.2 still supports it, and many internal PKI infrastructures haven't migrated. For any new project, SHA-256 or SHA-512 provides equivalent or better security with no compatibility penalty.

Performance benchmarks across architectures

SHA-2 performance varies significantly by platform. On 64-bit Intel/AMD CPUs with AES-NI and SHA extensions (Intel SHA-NI from Haswell, AMD from Excavator), SHA-512 can reach 2-3 GB/s throughput. SHA-256 benefits similarly from Intel's shaext instructions, achieving comparable speeds. On 32-bit ARM processors (common in IoT devices and older smartphones), SHA-256 is generally faster because the algorithm's 32-bit word size matches the native architecture. SHA-512 on 32-bit requires emulating 64-bit arithmetic, adding overhead. OpenSSL benchmarks show SHA-512 outperforming SHA-256 by 20-40% on 64-bit x86_64, while SHA-256 leads by 10-20% on 32-bit ARM. For most applications, the difference is negligible — choose based on security requirements and target platform rather than raw speed.

Frequently Asked Questions (FAQs)

Should I use SHA-256 or SHA-512?

On 64-bit systems, SHA-512 is often faster than SHA-256 due to native 64-bit word operations. On 32-bit systems, SHA-256 is faster. Both offer equivalent security margins — SHA-256 provides 128-bit collision resistance and SHA-512 provides 256-bit collision resistance. For most applications, SHA-256 is sufficient and more widely supported.

Is SHA-1 still safe to use?

No. SHA-1 has been broken since 2017 with practical collision attacks demonstrated by Google and CWI Amsterdam. All major browsers reject SHA-1 certificates, and Git has migrated away from it. Use SHA-256 for any new project. Only keep SHA-1 for reading legacy data that was already hashed with it.

What's the difference between SHA-512/224 and SHA-224?

SHA-224 is derived from SHA-256's initialization constants, while SHA-512/224 is SHA-512 truncated to 224 bits. They produce different outputs for the same input because they use different compression functions. SHA-512/224 is preferred when you want the security margin of SHA-512's compression function with a shorter output.

How long should my hash output be?

For collision resistance, aim for at least 128 bits (SHA-256). For preimage resistance, 256 bits (SHA-256) or 512 bits (SHA-512) is excellent. Truncated variants like SHA-512/256 give you 128-bit collision resistance with SHA-512's faster compression. For most applications, the full SHA-256 output (64 hex characters) is the sweet spot.

Can I use SHA-2 for password hashing?

Not directly. SHA-2 is too fast for password hashing — attackers can compute billions of SHA-256 hashes per second with GPUs. Use purpose-built password hashing functions like bcrypt, Argon2id, or scrypt instead. These are deliberately slow and include salt and configurable work factors to resist brute-force attacks.

Why does Git use SHA-1?

Git originally chose SHA-1 in 2005 because it was considered secure at the time and produced compact 160-bit hashes ideal for distributed version control. Git is actively migrating to SHA-256 to address collision concerns. The migration is opt-in for now but will become mandatory in future versions.

What's the maximum input size for SHA-2?

SHA-2 supports messages up to 2^64 bits (approximately 1.84 × 10^19 bits or 2 exabytes) for SHA-256, and up to 2^128 bits for SHA-512. In practice, you'll never hit these limits — even processing terabytes of data would take considerable time.

Recently Used Tools