Skip to main content
Develop Tools
← Return to usage guide

Generate a SHA-256 Hash | Complete Guide to Usage, Settings, and Troubleshooting

When generating SHA-256, the input is the encoded Byte sequence, not the string shown on screen. Fix the Algorithm, UTF-8, line breaks, and display format before calculating.

The flow for converting a string to a UTF-8 Byte sequence and generating a fixed-length SHA-256 Digest
The flow for converting a string to a UTF-8 Byte sequence and generating a fixed-length SHA-256 Digest

Generate and verify hashes under the same input conditions

Generate Digests using five methods in the Browser from a string or local file, then compare them with known HEX or Base64 values.

Generate a SHA-256 hash

Conclusion: Fix the algorithm and UTF-8 byte sequence, then verify the generated 64-character HEX value

Text is converted to a UTF-8 byte sequence with TextEncoder, and that byte sequence is passed to SHA-256. The Digest is 32 bytes; in HEX display, each byte is represented by two characters, for a total of 64 characters.

Even if they look the same, different encoding, line breaks, spaces, or Unicode code point sequences produce different hashes. This is not called encryption with SHA-256.

The current Tool generates all 5 methods at once. Check the SHA-256 row in the result table and the selected HEX/Base64 format.

Check the three stages: String, byte sequence, and Digest

What a hash function directly receives is not the meaning of characters but a byte sequence. Match the encoding used by the environment that stores or sends the input.

Current Text Mode is fixed to UTF-8 and does not add a BOM or normalize Unicode. It also cannot specify Shift_JIS.

ItemHow to checkjudgment
AlgorithmSHA-256 row in the results tableDo not confuse it with other methods
EncodingText Mode uses UTF-8Matches the comparison source
InputCheck including line breaks and spacesDo not trim automatically
output64 HEX characters or Base64Compare using the same representation.

How to check using the hash generation and verification tool

  1. Select the text and paste it without changing the original.
  2. Set the display format to HEX and select lowercase or uppercase if needed.
  3. Generate a hash value and check the SHA-256 line.
  4. If necessary, enter the value to compare and check the match display.

An empty string cannot be generated in Text Mode. You can check the SHA-256 of empty data as a 0-byte file in File Mode.

Do not confuse SHA-256 input and output.

String "hello"
  -> UTF-8 bytes 68 65 6c 6c 6f
  -> SHA-256 digest (32 bytes)
  -> HEX / Base64 text

HEX and Base64 can represent the same digest byte sequence as different strings. Comparing HEX and Base64 as strings does not produce a match.

Consider hashing, encryption, encoding, and authentication separately

processingInputOutput and purposeAction to return to the original
HashByte sequences of arbitrary lengthFixed-length digest and integrity verificationNot intended for decryption
EncryptionPlaintext and KeyCiphertext and confidentialityDecrypt with the correct key
Base64Byte columnRepresent as ASCII text.Return to the original byte sequence by decoding
HMACSecret Key and MessageAuthentication codes, integrity, and authenticityRecalculate and verify using the same key.
Password HashPassword, Salt, and CostMake guessing attacks costly and verifyUse a dedicated scheme such as Argon2id.

Do not describe a hash as “encrypted with SHA-256.” The same input byte sequence and algorithm produce the same digest, but this does not mean different inputs can never produce the same value anywhere in the world. Also verify separately whether the source distributing the expected value is trustworthy.

Treat MD5 and SHA-1 as compatibility checks for legacy systems or existing checksums; do not recommend them for new uses requiring tamper resistance. Do not use fast general-purpose SHA-256 alone for password storage; select a purpose-appropriate scheme and settings such as Argon2id, scrypt, bcrypt, or PBKDF2.

Supported scope of the current hash generation and verification tool

ItemCurrent specification
InputUTF-8 text or multiple local files
AlgorithmGenerate SHA-512, SHA-384, SHA-256, SHA-1, and MD5 at once
outputHEX or Base64. HEX can be switched between lowercase and uppercase
VerificationCompare expected values with all results. HEX is case-insensitive; Base64 is case-sensitive
Processing methodRead the entire file into an ArrayBuffer with FileReader and calculate in a Web Worker
ActionsIndividual copy, copy all, clear all, cancel processing, and process multiple files
UnsupportedSHA-224, SHA-3, HMAC, Encoding selection, BOM removal, line-break conversion, Unicode normalization, Streaming, and Download
Empty dataEmpty input in the Text field is an Error. A 0-byte File can be calculated in File Mode

Text Mode converts to a UTF-8 byte sequence using TextEncoder. It does not trim input Text, normalize line endings, remove BOMs, or perform Unicode Normalization. However, only the comparison field removes leading, trailing, and embedded whitespace from the pasted Digest before comparison.

SHA-1, SHA-256, SHA-384, and SHA-512 are calculated with the Web Crypto API; MD5 is calculated with an implementation in a Worker. The Hash target is the loaded Byte sequence, not the file name or modification time.

Browser processing and large-file limitations

The current tool does not send input text, file contents, generated digests, or expected digests to the DevelopTools server or external APIs, and does not save them to LocalStorage or SessionStorage. It also does not send input values to analytics.

  • Process confidential files on a trusted device and browser
  • After copying, consider that it may remain in OS or browser clipboard history
  • Because the entire file is loaded into memory, check available memory and browser limits
  • For very large files, also consider OS commands and similar tools that support streaming.
  • Obtain verification values through trusted channels such as official sites or signed channels

Because SubtleCrypto.digest() does not accept Streaming Input, the current implementation also reads the entire File into Memory. Browser-based processing avoids Uploads, but it does not guarantee protection from Malware or malicious Extensions on the device.

Check the algorithm and scope of use using primary sources

Prioritize NIST for algorithm definitions and migration policies, MDN and the Web Cryptography specification for browser APIs, OWASP for password storage, and official documentation for each OS command. Also check commands in articles against the help for the version you use.

Example: pass hello as UTF-8 to SHA-256

Enter hello with no line break in Text Mode and check the SHA-256 row in lowercase hex.

The same input, encoding, and algorithm produce the same 64-character hexadecimal value. Adding a trailing Enter produces a different value.

  1. Enter hello
  2. Select lowercase HEX
  3. Select "Generate hashes".
  4. Copy the SHA-256 row.

Use only dummy data for values included in articles or tests.

Frequently asked questions

Is SHA-256 encryption?
No. It is a Hash Function that produces a fixed-length Digest from input data. Its purpose and properties differ from encryption that decrypts original Data with a Key and from decodable Base64.
If the Hash matches, is the File always safe?
You can verify that content matches the expected Digest, but that does not automatically establish trust in the source that published the expected value or the distribution path. Also check the official distributor, HTTPS, signatures, and more.
Can I use MD5 or SHA-1 for new purposes?
It remains for Legacy compatibility checks but is not recommended for new Security uses. Unless specified otherwise, consider SHA-256 or higher and follow Protocol or distribution-source requirements.
Is the input content sent to the Server?
Current DevelopTools processes Text, File contents, generated Hashes, and expected Hashes in the Browser without sending them to external APIs.