# SHA Hash Generator

- **URL:** https://codeasystem.com/calculators/developer/hash-generator/
- **Category:** developer
- **Description:** Compute SHA-1, SHA-256, SHA-384 and SHA-512 digests of any text at once using the browser’s native WebCrypto engine.
- **Primary output:** SHA-256 digest: ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad

## Inputs
- Text to hash (name: `text`, type: textarea, example: any text; empty input hashes the empty string)
- Primary algorithm (name: `algorithm`, type: select)

## Outputs
- SHA-256 digest: ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
- SHA-1 digest: a9993e364706816aba3e25717850c26c9cd0d89d
- SHA-384 digest: cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7
- SHA-512 digest: ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f

## Formula / methodology
```
digest = SHA-x(UTF-8(text)) rendered as 160/256/384/512-bit lowercase hex
```

Your text converts to UTF-8 bytes and passes through the built-in WebCrypto digest function for each algorithm simultaneously. All four hex digests appear together so you can copy whichever your protocol needs and cross-check consistency at a glance.

Empty input is legitimate: hashing the empty string yields the well-known published digest, so the tool shows a result immediately rather than demanding text first.

## Assumptions & limitations
- Input treated as UTF-8 text; binary files need a different tool.
- Digests are one-way; there is no decrypting a hash.
- SHA-1 is provided for legacy checksums only, not security.

## How to use
1. **Paste your text**; Config values, license keys, integrity-check payloads; anything textual.
2. **Pick the primary digest**; The chosen algorithm headlines; all four compute regardless for comparison.
3. **Copy the hex string**; Lowercase hex; the conventional representation everywhere.

## Example
The famous test vector abc hashes under SHA-256 to ba7816bf…f20015ad; matching the FIPS 180 reference exactly, byte for byte.

Result for these inputs:

```
SHA-256 digest: ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
```

## About this calculator
### Choosing among the SHAs

SHA-256 is the modern default for signatures, integrity checks and blockchains. SHA-384/512 offer larger margins (and SHA-512 often runs faster on 64-bit CPUs). SHA-1 survives only in legacy systems; practical collision attacks have existed since 2017, so never accept it for new security designs.

### Hashes verify, they do not encrypt

- Same input → same digest, deterministically
- Tiny change → avalanche: roughly half the output bits flip
- Cannot reverse a digest; verification works by recomputing
- For passwords use dedicated KDFs (bcrypt, argon2), never bare SHA

## FAQs
### Why do all four digests show at once?

They cost almost nothing to compute together, and side-by-side output catches copy-paste mistakes between algorithms instantly.

### Can I hash a file here?

This tool accepts text only. For binaries use your OS: shasum -a 256 file (macOS/Linux) or Get-FileHash (Windows).

### Is hashing a password with SHA-256 acceptable?

No; it is far too fast for attackers. Use bcrypt, scrypt or argon2 with salt; those are deliberately slow key-derivation functions.

### Where is computation performed?

In-browser via the native WebCrypto API; your text never leaves the page.

## Related calculators
- [HMAC Generator](https://codeasystem.com/calculators/developer/hmac-generator/)
- [Password Strength Calculator](https://codeasystem.com/calculators/developer/password-strength-calculator/)
- [JWT Decoder](https://codeasystem.com/calculators/developer/jwt-decoder/)

---
Last updated: 2026-08-23 · Version: 1.0.0 · [HTML version](https://codeasystem.com/calculators/developer/hash-generator/)
