Hash Generator Online — MD5, SHA-256, SHA-512 & More
Free online hash generator for text and files. MD5, SHA-1, SHA-256, SHA-384, SHA-512 with HMAC support. Client-side Web Crypto API, batch mode, file streaming.
Why Generate Hashes?
Hash functions are the backbone of modern computing — verifying file integrity, storing passwords securely, signing digital certificates, and powering blockchain. But choosing the right algorithm and implementing it correctly is critical.
An online hash generator lets you instantly compute checksums for text or files without installing tools. DevStackIO's Hash Generator supports MD5, SHA-1, SHA-256, SHA-384, SHA-512 — all client-side via Web Crypto API. Your data never leaves your browser.
What Is a Cryptographic Hash?
A hash function takes arbitrary input and produces a fixed-size output (digest) with these properties:
| Property | Description |
|---|---|
| Deterministic | Same input → same output, always |
| Fast computation | Efficient for any input size |
| Pre-image resistance | Given hash, can't find input |
| Second pre-image resistance | Given input, can't find different input with same hash |
| Collision resistance | Can't find any two inputs with same hash |
| Avalanche effect | Tiny input change → completely different output |
Input: "Hello World"
SHA-256: a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e
Input: "Hello World!" (added exclamation)
SHA-256: 7d9a2f3b8c1e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9
↑ Completely different
Algorithm Comparison
| Algorithm | Output Size | Speed | Security Status | Use Case |
|---|---|---|---|---|
| MD5 | 128-bit (32 hex) | Fastest | Broken — collisions trivial | Checksums only (non-security) |
| SHA-1 | 160-bit (40 hex) | Fast | Broken — chosen-prefix collisions | Legacy systems, Git (migrating) |
| SHA-256 | 256-bit (64 hex) | Fast | Secure — standard for TLS, Bitcoin, certificates | Default choice |
| SHA-384 | 384-bit (96 hex) | Medium | Secure — SHA-2 family, longer output | High-security requirements |
| SHA-512 | 512-bit (128 hex) | Medium | Secure — SHA-2 family, 64-bit optimized | Maximum security margin |
| SHA-3 (Keccak) | 224–512-bit | Slower | Secure — different internal structure | Diversification, future-proofing |
| BLAKE2 | 256/512-bit | Fastest | Secure — modern, faster than SHA-2 | Performance-critical apps |
| BLAKE3 | 256-bit | Fastest | Secure — parallelizable, SIMD | High-throughput hashing |
Recommendation: Use SHA-256 for most cases. Use SHA-512 for long-term secrets. Avoid MD5/SHA-1 for security purposes.
Common Use Cases
1. File Integrity Verification
# Download page shows: SHA-256: a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e
# Verify after download:
sha256sum downloaded-file.iso
# Compare output to published hash
2. Password Hashing (Don't Use Raw Hashes!)
# ❌ WRONG — Fast hash = easy to crack
hash = hashlib.sha256(password.encode()).hexdigest()
# ✅ CORRECT — Slow, salted, memory-hard
import bcrypt
hash = bcrypt.hashpw(password.encode(), bcrypt.gensalt())
# Or Argon2 (winner of Password Hashing Competition)
import argon2
ph = argon2.PasswordHasher()
hash = ph.hash(password)
3. Digital Signatures & Certificates
Certificate → Hash (SHA-256) → Sign with private key (RSA/ECDSA)
Verify: Hash(certificate) == Decrypt(signature, public key)
4. HMAC (Keyed Hash for API Auth)
import hmac, hashlib
secret = b"shared-secret"
message = b"GET /api/users 1704067200"
signature = hmac.new(secret, message, hashlib.sha256).hexdigest()
# Client sends: Authorization: HMAC signature
# Server verifies with same secret
5. Git & Version Control
# Git uses SHA-1 for object IDs (migrating to SHA-256)
git log --oneline
# a1b2c3d Commit message
# ^ SHA-1 hash of commit object
6. Blockchain & Cryptocurrency
Bitcoin: Double SHA-256 (SHA-256(SHA-256(data)))
Ethereum: Keccak-256 (SHA-3 variant)
How to Generate Hashes Online (Step by Step)
- Open the generator — DevStackIO Hash Generator
- Select algorithm — MD5, SHA-1, SHA-256, SHA-384, SHA-512
- Input data — Paste text, type directly, or upload a file (drag-and-drop)
- Choose encoding — UTF-8 (default), Base64, Hex for input interpretation
- Generate — Click "Generate" — hash appears instantly
- Copy or download — One-click copy, or download as
.txtwith algorithm label - Verify — For files, compare with published checksum
Hash Generator Features
| Feature | Description |
|---|---|
| Multi-algorithm | MD5, SHA-1, SHA-256, SHA-384, SHA-512 simultaneously |
| File hashing | Drag-and-drop files up to 100MB, streamed via Web Worker |
| Text hashing | Real-time as you type |
| HMAC support | Keyed hashing with secret key input |
| Batch mode | Hash multiple files at once |
| Format options | Hex (default), Base64, raw binary download |
| Compare | Paste expected hash → auto-verify match (green/red) |
Programming Language Examples
JavaScript / TypeScript (Web Crypto API)
// Browser: Modern, native, no dependencies
async function hash(text: string, algorithm: 'SHA-256' | 'SHA-512' = 'SHA-256'): Promise<string> {
const encoder = new TextEncoder();
const data = encoder.encode(text);
const hashBuffer = await crypto.subtle.digest(algorithm, data);
return Array.from(new Uint8Array(hashBuffer))
.map(b => b.toString(16).padStart(2, '0'))
.join('');
}
// Node.js 18+ (global crypto)
import { createHash } from 'crypto';
function hashNode(text: string, algorithm = 'sha256'): string {
return createHash(algorithm).update(text).digest('hex');
}
// HMAC
async function hmacSha256(key: string, message: string): Promise<string> {
const encoder = new TextEncoder();
const cryptoKey = await crypto.subtle.importKey(
'raw', encoder.encode(key), { name: 'HMAC', hash: 'SHA-256' }, false, ['sign']
);
const sig = await crypto.subtle.sign('HMAC', cryptoKey, encoder.encode(message));
return Array.from(new Uint8Array(sig)).map(b => b.toString(16).padStart(2, '0')).join('');
}
Python
import hashlib, hmac
# Basic hashing
def hash_text(text: str, algorithm: str = 'sha256') -> str:
h = hashlib.new(algorithm)
h.update(text.encode('utf-8'))
return h.hexdigest()
# File hashing (streaming for large files)
def hash_file(path: str, algorithm: str = 'sha256') -> str:
h = hashlib.new(algorithm)
with open(path, 'rb') as f:
for chunk in iter(lambda: f.read(8192), b''):
h.update(chunk)
return h.hexdigest()
# HMAC
def hmac_sha256(key: str, message: str) -> str:
return hmac.new(key.encode(), message.encode(), hashlib.sha256).hexdigest()
# Verify
expected = "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e"
actual = hash_file("download.iso")
assert actual == expected, "File corrupted or tampered!"
Go
import (
"crypto/sha256"
"crypto/hmac"
"encoding/hex"
"hash"
)
func hashText(text string, algorithm func() hash.Hash) string {
h := algorithm()
h.Write([]byte(text))
return hex.EncodeToString(h.Sum(nil))
}
func hashFile(path string) (string, error) {
f, err := os.Open(path)
if err != nil { return "", err }
defer f.Close()
h := sha256.New()
if _, err := io.Copy(h, f); err != nil { return "", err }
return hex.EncodeToString(h.Sum(nil)), nil
}
func hmacSha256(key, message string) string {
h := hmac.New(sha256.New, []byte(key))
h.Write([]byte(message))
return hex.EncodeToString(h.Sum(nil))
}
// Usage
hash := hashText("Hello World", sha256.New)
hash = hashText("Hello World", sha512.New)
Rust
use sha2::{Sha256, Sha512, Digest};
use hmac::{Hmac, Mac};
fn hash_text(text: &str) -> String {
let mut hasher = Sha256::new();
hasher.update(text.as_bytes());
format!("{:x}", hasher.finalize())
}
fn hash_file(path: &str) -> std::io::Result<String> {
let mut file = std::fs::File::open(path)?;
let mut hasher = Sha256::new();
std::io::copy(&mut file, &mut hasher)?;
Ok(format!("{:x}", hasher.finalize()))
}
fn hmac_sha256(key: &[u8], message: &[u8]) -> String {
let mut mac = Hmac::<Sha256>::new_from_slice(key).unwrap();
mac.update(message);
format!("{:x}", mac.finalize().into_bytes())
}
Command Line
# Linux / macOS
echo -n "Hello World" | sha256sum # SHA-256
echo -n "Hello World" | sha512sum # SHA-512
echo -n "Hello World" | md5sum # MD5
sha256sum file.iso # File
# Windows (PowerShell)
Get-FileHash -Algorithm SHA256 file.iso
# Or: certutil -hashfile file.iso SHA256
# Verify checksum
echo "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e file.iso" | sha256sum -c
Security: When NOT to Use These Hashes
| Scenario | Why It's Wrong | Use Instead |
|---|---|---|
| Password storage | Too fast — GPU cracks billions/sec | bcrypt, Argon2, scrypt, PBKDF2 |
| API keys / tokens | No secret — anyone can compute | HMAC with secret, or random tokens |
| Digital signatures | No private key — forgeable | RSA/ECDSA/EdDSA signing |
| Message authentication | No key — tampering undetectable | HMAC, AES-GCM, ChaCha20-Poly1305 |
| Key derivation | No salt, no iteration | HKDF, PBKDF2, Argon2 |
Password Hashing Comparison
| Algorithm | Time (100k iter) | Memory | GPU Resistance | Status |
|---|---|---|---|---|
| SHA-256 | ~0.001 ms | Zero | None | ❌ Never |
| PBKDF2-SHA256 | ~100 ms | Low | Low | ⚠️ Legacy |
| bcrypt | ~100 ms | 4 KB | Medium | ✅ Good |
| scrypt | ~100 ms | 16 MB | High | ✅ Good |
| Argon2id | ~100 ms | Configurable | High | ✅ Best |
FAQ
Can I reverse a hash to get the original input? No. Cryptographic hashes are one-way functions. The only way is brute-force or rainbow tables — infeasible for SHA-256+.
Why does the same input produce different hashes? Check: trailing newline, encoding (UTF-8 vs UTF-16), whitespace, BOM. Use "Show bytes" feature to debug.
Is MD5 completely broken? For collisions — yes (practical chosen-prefix attacks exist). For file integrity against accidental corruption — still fine. Never for security.
What's the difference between SHA-256 and SHA-512? Output size (256 vs 512 bits), internal word size (32 vs 64 bits). SHA-512 is faster on 64-bit CPUs. Both are secure.
Can I hash a 10GB file?
Browser: up to ~100MB (memory). For larger files, use CLI tools (sha256sum, certutil, streaming code).
What is HMAC and when do I need it? HMAC = Hash-based Message Authentication Code. Uses a secret key. Verifies both integrity AND authenticity. Use for API signatures, JWT (HS256), cookie signing.
Does the tool support SHA-3 / BLAKE2 / BLAKE3? Not yet. SHA-256/384/512 cover 99% of use cases. Note that SHA-3 and BLAKE are not exposed by the browser Web Crypto API, so supporting them would require shipping a dedicated in-browser implementation — it's on the roadmap, not currently available.
Is my data sent to your server? Never. All hashing happens in your browser via Web Crypto API. Zero network requests.
Related Tools
- File Checksum Calculator — Dedicated file hashing with multiple algorithms
- HMAC Generator — Keyed hashing for API signatures
- Bcrypt Generator — Password hashing with salt/cost
- JWT Generator — HS256/RS256 token signing
- Token Generator — Random secure tokens
- Password Strength Analyzer — Analyze password entropy
References
- NIST FIPS 180-4 — Secure Hash Standard (SHA)
- RFC 6234 — US Secure Hash Algorithms (SHA)
- RFC 2104 — HMAC: Keyed-Hashing for Message Authentication
- OWASP Password Storage Cheat Sheet
- Argon2 Specification (RFC 9106)
- BLAKE2 / BLAKE3 Specifications
- SHA-1 Collision Attack (SHAttered)
Generate hashes now → Free Hash Generator — MD5, SHA-1, SHA-256, SHA-384, SHA-512. File & text, HMAC support, batch mode. 100% client-side.
Related Resources
More Blog Posts
- Base64 Encode/Decode Online — Free Tool for Developers
- UUID v4 vs v7 Generator — Which UUID Version Should You Use?
- SQL Formatter Online — Format, Beautify & Validate SQL Queries
- Image Compressor for Web — Reduce Size 40-80% (JPEG, PNG, WebP, AVIF)
- URL Parser & Analyzer — Break Down Any URL Into Components