Generating a SHA256 hash from a string means encoding that string as UTF-8 bytes, applying the standard SHA-256 algorithm, and reading the resulting 32-byte digest as 64 lowercase hexadecimal characters or standard padded Base64. The SHA256 Hash Generator performs that operation in the current browser tab, so the selected text or file content is not uploaded. For a string, the important detail is that SHA-256 does not hash abstract characters; it hashes the exact byte sequence produced by UTF-8 encoding. Paste the content unchanged, check the byte count, generate the digest, and copy the representation required by the other system. If the goal is to verify a download, compare the complete output with a checksum obtained through an authenticated source and confirm that both sides hashed the same bytes. The same process applies when a build, deployment, or release workflow requires a standard SHA-256 value. A matching digest is useful for integrity checking, but it does not by itself prove who created the input or protect a password.
SHA-256 is deterministic for the same algorithm and bytes. Changing the presentation does not change the underlying digest: uppercase and lowercase Hex represent the same digest bytes, while Hex and Base64 are two textual encodings of the same 32-byte result. The output format matters only because a verifier may expect one exact representation. The tool provides lowercase Hex and standard padded Base64 so either can be copied without conversion.

Choose the bytes that belong in the hash
For a string, choose text mode and enter the content exactly as it should be hashed. Text mode first encodes the string as UTF-8, so the displayed byte count provides useful context for the result. Characters outside ASCII, including accented letters, emoji, and scripts using other writing systems, can occupy multiple bytes. A space, carriage return, or final newline is also part of the input and can change the digest. Empty text is accepted because the empty byte sequence has a legitimate standard SHA-256 digest.
File mode follows a different input path. It bypasses text decoding and hashes every byte in the selected local file, including headers, embedded metadata, and line-ending bytes. To reproduce the digest of a downloaded artifact, hash the file itself rather than assuming that pasted or visibly displayed text represents the same bytes.
| Input mode | What gets hashed | Details that affect the result |
|---|---|---|
| Text mode | The UTF-8 bytes produced from the entered string | Spaces, Unicode normalization form, final newlines, and multi-byte characters can change the bytes. The displayed byte count helps identify the input. |
| File mode | Every byte in the selected local file | Headers, metadata, binary content, and CRLF or LF line endings remain part of the hashed data. |
Generate a SHA256 hash from a string
- Select the input and enter the exact content. Choose text mode and paste the string to be hashed, then note the displayed UTF-8 byte count. If the required digest belongs to a file, select that local file instead.
- Generate the SHA-256 value and choose its representation. Generate the digest, then copy either the 64-character lowercase Hex value or the standard padded Base64 value expected by the other system.
- Compare the complete result. Compare every character with an authenticated reference value and confirm that both systems processed the same bytes in the same representation.
The two output formats are not different hashes. Hex presents the 32 digest bytes as 64 hexadecimal characters, while Base64 presents those same bytes in the standard padded alphabet. Copy the format requested by a checksum file, API, build step, or deployment system. A Base64 digest should not be compared directly with a Hex digest as though the two text strings were interchangeable.
| Option | Exact output | Comparison rule |
|---|---|---|
| Hex | 64 lowercase hexadecimal characters | Compare with a hexadecimal reference using the complete value. |
| Base64 | Standard padded Base64 | Compare with a Base64 reference using the complete value. |
| Digest size | 32 bytes in either representation | Changing the representation does not change the underlying digest bytes. |
See how the standard operation is defined
SHA-256 belongs to the SHA-2 family specified by NIST FIPS 180-4. The standard pads the message, divides it into 512-bit blocks, expands each block into a 64-word schedule, and updates eight 32-bit working values. The final eight words form the 256-bit digest. The generator delegates this exact operation to the platform cryptography implementation rather than substituting a custom transformation.
Its test suite includes eight golden fixtures drawn from NIST and RFC examples, along with independently cross-checked text, punctuation, UTF-8, and binary cases. Those tests assert the exact digest, the fixed 32-byte result size, and the standard Base64 encoding. This matters because a tool can display a consistent value without necessarily implementing the standard correctly; comparison with known vectors tests algorithm correctness rather than merely checking a self-consistent round trip.
Match the full digest with an authenticated reference
For an integrity check, compare the complete digest, not a shortened prefix. The expected value must also be authentic. Obtain reference hashes over HTTPS from the file owner, through a signed release, or through another authenticated channel appropriate to the risk. Then confirm that the local file and the reference system used identical bytes. For text, that means the same UTF-8 content; for a file, it means the same artifact rather than a copied excerpt or a re-exported version.
Authentication of the reference is essential because SHA-256 alone does not establish authorship. If an attacker can replace both a file and the checksum displayed beside it, recomputing SHA-256 will confirm the attacker's pair. The hash demonstrates that the checked bytes agree with the supplied digest, but the trust decision depends on where that digest came from and how it was protected.
Locate the exact source of a mismatched result
When a browser-generated digest differs from a command-line result, compare the inputs before comparing the displayed hashes. The same visible text can produce different byte sequences, while a file may contain bytes that are not visible when its contents are pasted into a text field.
- An added newline or carriage return: Some shell commands append a final newline, so the command may hash different bytes from the string shown on screen.
- Different text encoding: Confirm that both sides read the string as UTF-8 when comparing text-mode results.
- Unicode normalization: Different normalization forms can represent visually similar text with different byte sequences.
- File bytes versus pasted text: A file can include headers, metadata, or line-ending bytes that are absent from a pasted representation.
- A different source artifact: Make sure the local download, command-line file, and published reference all refer to the same version.
When checking a command-line utility, ensure that it did not append a newline and that it read the same file. Spaces, Unicode normalization forms, carriage returns, and final newlines are all significant because SHA-256 operates on exact bytes. Hex letter case is the exception: changing letter case changes presentation, not the underlying digest bytes.
Keep integrity checks separate from authentication and password storage
SHA-256 is a one-way hash, not encryption. It creates a fixed-length digest without a key, and there is no supported reverse operation that recovers the original input. It also does not authenticate who created the input. Use HMAC-SHA-256 when two systems share a secret and need message authentication, or use a digital signature when a verifier must establish origin through a public key. This page intentionally performs only the raw standard digest.
Do not store passwords by applying SHA-256 directly. Its speed is valuable for integrity checks, but that speed also helps attackers test password guesses. Account systems should use a unique salt and a purpose-built password hashing function with calibrated memory and time cost rather than a plain SHA-256 digest.
Handle large files with a streaming workflow
The generator accepts local files up to 100 MB. The Web Cryptography digest interface used by the page receives the complete byte buffer rather than a stream, so processing a much larger file in the browser could exhaust available memory. For larger artifacts, use a trusted streaming tool on the local machine instead.
Within its supported limit, SHA-256 checksums are useful for comparing a local download with a digest published by a trusted vendor, checking whether two artifacts produce the same digest, or supplying a value required by a build and deployment workflow. In each case, preserve the artifact's exact bytes and obtain the expected value through an authenticated channel.
Record enough context to reproduce the result
When saving a digest, record the algorithm name SHA-256 alongside the value, along with its Hex or Base64 representation. For text, note the UTF-8 byte count and whether the source includes a trailing newline; for a file, record the artifact name and version. This context prevents a 64-character SHA-256 value from later being confused with another format or an undocumented checksum. A future comparison is reliable only when the complete digest, output representation, and source bytes all align.
Related reading: SHA 512 Hash Generator SHA512 Online: Fix Mismatches.
Related reading: Base58 Decode on Windows: Browser Steps and Byte Checks.