Theme: -
Font size:

SHA256 Hash Generator - SHA-256 Hex, Base64, and SRI

Compute a single 256-bit SHA-256 hash from UTF-8 text in hex, Base64, Base64URL, or SRI with LF/CRLF endings.

For a multi-line list requiring one SHA-256 digest per row, use our Bulk SHA256 Hash Generator.

🔒 Data Safety: We process everything securely and never store or share it.

Enter your text:

How to Use

  1. Enter your UTF-8 string in the input box, click "Open File", or drop a text file directly.
  2. Select an "Output Format", toggle "Uppercase (A-F)", and set "Line Endings" in the options below the box.
  3. Click "Hash" to compute one 256-bit FIPS 180-4 SHA-256 digest across your entire text input.
  4. Use the "Copy" or "Download" button above the result box to export your formatted SHA-256 output.

Options Explained

  • Output Format: Choose "Hex (64-char)", "Base64 (44-char)", "Base64URL (PKCE)", or "SRI (sha256-...)" encoded from 32 raw digest bytes. Base64URL omits padding for OAuth 2.0 PKCE S256 challenges, while SRI builds HTML integrity attributes.
  • Uppercase (A-F): Convert hexadecimal letters a-f to uppercase A-F when "Hex (64-char)" is selected. Choosing Base64, Base64URL, or SRI disables this option automatically to preserve case-sensitive encoding.
  • Line Endings: Standardize multi-line text to Unix/Web LF (\n) or Windows CRLF (\r\n) bytes before computing the hash.

Key Features

  • Produce 256-bit SHA-256 cryptographic digests conforming to FIPS PUB 180-4 and RFC 6234 specifications.
  • Output the 32 binary digest bytes in hex (64 chars), padded Base64, unpadded Base64URL for PKCE, or W3C SRI strings.
  • Combine multi-line text, single strings, or empty input into one unified 256-bit SHA-256 checksum.
  • Preserve leading spaces, trailing spaces, and internal blank lines without automatic string trimming before hashing.
  • Configure lowercase (a-f) or uppercase (A-F) hex output alongside LF (\n) and CRLF (\r\n) newline normalization.
  • Encode accented Latin letters, CJK, Arabic, Cyrillic scripts, and multi-byte emojis into UTF-8 byte arrays before hashing.
  • Execute FIPS 180-4 message scheduling and 64-round compression locally in your browser with no server logging.

About This Online SHA256 Hash Generator

Built on FIPS 180-4, this SHA256 hash generator outputs 256-bit digests in hex, Base64, Base64URL, or SRI. Every 64-round compression cycle executes locally in your browser alongside uppercase hex and LF/CRLF newline controls.

Developed and maintained by the PU Tools team, this tool gives you fast, accurate, safe, and easy results in just a few clicks.

Common Use Cases

  • OAuth 2.0 PKCE S256 Challenges: Convert code verifier strings directly into unpadded 43-character Base64URL challenges per RFC 7636.
  • Subresource Integrity (SRI) Tags: Generate sha256- Base64 strings from external scripts or stylesheets for HTML integrity attributes.
  • Release and API Payload Checksums: Compare 64-character hex or 44-character Base64 digests across Unix LF and Windows CRLF payloads.

Example Input and Output

Example Input

Hello World! Welcome to PU Tools.

Options used: Output Format: Hex (64-char) | Uppercase (A-F): OFF | Line Endings: LF (\n) - Unix/Web

Example Output

a655529520333c61377303db019fa4cf1a6c4af2343e5242fcd334d25f62f6fb

Your browser outputs a 64-character (256-bit) lowercase hexadecimal SHA-256 digest for the input UTF-8 string.

SHA256 Hash Generator Example
Screenshot: Actual output of the SHA256 Hash Generator

Frequently Asked Questions

What is the difference between this tool and the Bulk SHA256 Hash Generator?

This generator treats your entire input box, including line breaks, as one string to produce one digest. Our Bulk SHA256 Hash Generator splits multi-line lists by row and calculates a separate SHA-256 hash per line.

Why is a Base64 SHA-256 digest 44 characters instead of 88 characters?

Base64 mode encodes the 32 raw binary digest bytes rather than the 64-character ASCII hex string. Base64URL drops trailing "=" padding for OAuth 2.0 PKCE, while SRI prepends "sha256-" for HTML integrity tags.

How do LF and CRLF line endings affect a multi-line SHA-256 digest?

Unix platforms encode each newline as one byte (LF, \n), while Windows uses two bytes (CRLF, \r\n). Because SHA-256 exhibits a strong avalanche effect, that extra carriage-return byte generates a completely different 256-bit digest.

What is the standard SHA-256 digest of an empty zero-byte string?

Under FIPS 180-4, a zero-byte string hashes to e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 in hex or 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= in Base64. Leaving the input box blank and clicking "Hash" lets you verify these official SHA-256 vectors directly.

Can a 256-bit SHA-256 digest be reversed, and how does it compare to MD5?

No, FIPS 180-4 defines SHA-256 as a one-way cryptographic hash function rather than reversible encryption. Unlike 128-bit MD5 and 160-bit SHA-1, 256-bit SHA-256 has no practical collisions and secures TLS signatures. Because raw SHA-256 is fast and unsalted, use Argon2, Bcrypt, or PBKDF2 to store passwords.

Does this generator support accented Latin letters, non-Latin scripts, and emojis?

Yes, the engine serializes your input into standard UTF-8 bytes before padding the 512-bit SHA-256 message blocks. Latin diacritics, CJK, Arabic, Cyrillic characters, and multi-byte emojis match Linux sha256sum and OpenSSL outputs.

Does this tool send my sensitive strings or SHA-256 hashes over the network?

No, all 64 compression rounds and UTF-8 byte conversions run locally inside your browser RAM using client-side JavaScript. We enforce zero server data storage so your raw text and formatted SHA-256 digests never leave your device.