BLAKE3 hash generator
BLAKE3, released in 2020 by Jack O’Connor, Jean-Philippe Aumasson, Samuel Neves and Zooko Wilcox-O’Hearn, is one of the fastest secure hash functions available. It splits input into 1 KiB chunks arranged in a Merkle tree, so large files can be hashed in parallel across many CPU cores and with SIMD instructions. This BLAKE3 generator computes the standard 256-bit hash and longer or shorter outputs.
Example
Input:
The quick brown fox jumps over the lazy dogBLAKE3 (256-bit):
2f1514181aadccd913abd94cfa592701a5686ab23f8df1dff1b74710febc6d4aBLAKE3 is an extendable-output function: the 512-bit output 2f1514181aadccd913abd94cfa592701a5686ab23f8df1dff1b74710febc6d4a… begins with exactly the 256-bit hash above. Unlike BLAKE2, choosing a different length does not change the earlier bytes.
At a glance
| Property | Value |
|---|---|
| Default output | 256 bits (64 hex characters); any length possible |
| Structure | Binary Merkle tree of 1 KiB chunks; compression function from BLAKE2s with 7 rounds |
| Security target | 128 bits |
| Modes | Hash, keyed hash (MAC) and key derivation — one algorithm |
| Released | 2020 |
Why BLAKE3 is so fast
- Parallelism: chunks are hashed independently and combined in a tree, so throughput scales with cores.
- SIMD: the design maps well to AVX2, AVX-512 and NEON, processing several chunks at once on one core.
- Fewer rounds: 7 rounds instead of BLAKE2s’s 10, based on extensive cryptanalysis of the BLAKE family.
The tree structure also enables verified streaming and incremental updates: a single changed chunk can be re-hashed without processing the whole file, which tools such as Bao build upon.
The main result shows BLAKE3 next to BLAKE2b, BLAKE2s and SHA-256 of the same input, so you can compare its output with older hashes you may already store.
Where BLAKE3 fits
BLAKE3 is a good default for file integrity, content addressing, deduplication and build caches, where both speed and security matter. It is newer and less standardised than SHA-256 — there is no FIPS approval — so regulated environments may still require SHA-256 or SHA-3. Like other fast hashes, it is not meant for password storage.
Command line: b3sum file prints the same 256-bit hash; b3sum --length 64 gives 512 bits. Python: the blake3 package. This tool offers the standard hash mode; BLAKE3’s keyed and key-derivation modes are available in its libraries. Hashing here runs locally in your browser.
When two BLAKE3 hashes do not match
Paste the expected value into Compare with an expected hash and the tool tells you whether it matches, or which other algorithm it matches instead. If there is no match at all, the input bytes differ. The usual causes:
- A trailing newline.
echo "text" | b3sumhashes the line break too. Useecho -norprintf, or hash the file itself with the File source. - Different output sizes. A 128-bit value is the first 32 hex digits of the 256-bit hash, so compare the right length.
- A different mode. Keyed hashes and derived keys use the same algorithm but give completely different output from the plain hash computed here.
- BLAKE2 instead of BLAKE3. The names look alike, but the functions are different. The comparison table shows BLAKE2b and BLAKE2s for exactly this reason.
Letter case never matters: 2F15… and 2f15… are the same hash.
BLAKE3 in Python
hashlib includes BLAKE2 but not BLAKE3, so install the blake3 package; its hasher follows the familiar update() and hexdigest() pattern. Two details catch people out. The input must be bytes, so encode text first, otherwise the call fails with a TypeError. And the output size is set with hexdigest(length=…) in bytes, not bits: the default of 32 bytes is the 256-bit hash, 16 gives 128 bits and 64 gives 512 bits. A shorter output is simply the beginning of a longer one.
# pip install blake3
from blake3 import blake3
text = "The quick brown fox jumps over the lazy dog"
data = text.encode("utf-8") # hash bytes, not str
print(blake3(data).hexdigest()) # 256 bits, 64 hex characters
print(blake3(data).hexdigest(length=16)) # 128 bits
print(blake3(data).hexdigest(length=64)) # 512 bits
# Large inputs: feed the hasher in chunks
hasher = blake3()
for chunk in (b"The quick brown fox ", b"jumps over the lazy dog"):
hasher.update(chunk)
print(hasher.hexdigest() == blake3(data).hexdigest()) # True
To confirm that your script hashes the same bytes, paste the text above: for the sample sentence both give a digest starting with 2f1514181aadccd9.