What Is a Hash Function?
A hash function takes input data and produces a fixed-length fingerprint. The same input always produces the same hash, but even a tiny change produces a completely different output. Hashes are used for checksums, cache keys, data integrity checks, content identifiers and many developer workflows. Hashing is one-way: you cannot recover the original input from the hash.
This Hash Generator supports MD5, SHA-1, SHA-256, SHA-384 and SHA-512. It accepts text, encodes it as UTF-8 and lets you copy the result as hexadecimal or Base64. Everything runs locally in your browser.
How to Generate a Hash
- Paste or type the text you want to hash.
- Choose an algorithm: MD5, SHA-1, SHA-256, SHA-384 or SHA-512.
- Choose hexadecimal or Base64 output.
- Select Generate hash.
- Copy or download the result.
The SHA algorithms use the browser's Web Crypto API. MD5 is computed locally with a bundled implementation. No input is uploaded.
MD5 vs SHA-1 vs SHA-256 vs SHA-512
MD5 and SHA-1 are older algorithms. They are fast and still appear in legacy checksums and non-security contexts, but they are not suitable for security-sensitive uses because practical collision attacks exist. SHA-256 and SHA-512 are part of the SHA-2 family and are the safer default for integrity checks, signatures and modern applications. SHA-384 offers a longer digest within the same family.
- MD5: 128-bit digest; legacy checksums only, not security.
- SHA-1: 160-bit digest; legacy compatibility, not recommended for new security work.
- SHA-256: 256-bit digest; a strong general-purpose default.
- SHA-384: 384-bit digest; useful when a longer SHA-2 output is required.
- SHA-512: 512-bit digest; strong, with a larger output.
Hexadecimal vs Base64 Output
Hexadecimal is the most common representation for hashes: two characters per byte, easy to compare and store. Base64 is more compact but uses case-sensitive characters and is less common for checksums. Use the format expected by the system that will consume the hash, and do not mix formats when comparing values.
Common Uses
- Verifying that two text values are identical.
- Generating stable cache keys or content identifiers.
- Creating checksums for configuration values or test fixtures.
- Debugging signature, token and integrity workflows.
- Comparing large text values without storing the originals.
For unique identifiers rather than fingerprints, use the UUID Generator. For reversible encoding, use the Base64 Encoder / Decoder.
Hashing Is Not Encryption
Hashing is one-way and cannot be reversed. Encryption is reversible with the right key. Do not use a fast hash such as MD5 or SHA-256 directly to store passwords; use a dedicated password hashing algorithm with a salt and appropriate work factor. Hashing also does not prove who created a value unless it is combined with a signature or keyed construction.
Why the Same Text Can Produce Different Hashes
Hash functions operate on bytes, not visible characters. Different encodings, trailing spaces, line endings, invisible Unicode characters or case changes will produce a different hash. If two values that look identical produce different hashes, compare them byte by byte, normalize line endings and check for hidden characters. For text, this tool consistently uses UTF-8.
Security Notes
- Use SHA-256 or stronger for new integrity and security work.
- Do not treat a hash as a secret; it is a fingerprint, not a password.
- Use a keyed MAC or a digital signature when authenticity matters.
- Avoid MD5/SHA-1 for signatures, certificates and password storage.
Related Tools
Decode encoded values with the Base64 Encoder / Decoder, inspect token payloads with the JWT Decoder, or convert timestamps with the Unix Timestamp Converter.