SHA-256 Hash Calculator

Popular

Generate, calculate, and verify SHA-256 hashes online from text, files, Hex, or Base64 input. Type or paste text, paste Hex or Base64 to hash the raw bytes, or drop a file to get its checksum. Paste an expected hash to check whether it matches. The 256-bit digest is shown as 64 hexadecimal characters or as Base64, and everything is calculated locally in your browser.

- OR DROP A FILE -

Drag and drop a file here or click to select

What is SHA-256?

SHA-256 (Secure Hash Algorithm 256-bit) is a cryptographic hash function from the SHA-2 family that converts input data into a fixed-length 256-bit (32-byte) hash value. The result is commonly displayed as a 64-character hexadecimal string.

A cryptographic hash works like a digital fingerprint of data. The same input always produces the same hash, while even a small change, such as adding a space or changing a character, produces a completely different result.

SHA-256 is widely used for verifying data integrity, checking downloaded files, digital signatures, certificates, and blockchain applications. It is a one-way function, meaning that the original input cannot feasibly be calculated from the hash alone.

For example, when downloading software, you can calculate its SHA-256 checksum client-side and compare it with the value published by the provider. Matching hashes provide strong evidence that the file has not been altered or corrupted. For message authentication with a secret key, use HMAC instead of a plain SHA-256 hash.

Is SHA-256 secure?

Yes. SHA-256 is considered secure for general-purpose cryptographic hashing, with no known practical collision or preimage attacks that compromise the full algorithm. It is widely used in digital signatures, certificates, integrity verification, and other security-sensitive applications.

SHA-256 is part of the SHA-2 family standardized by the U.S. National Institute of Standards and Technology (NIST). Unlike SHA-1, which is vulnerable to practical collision attacks, SHA-256 remains suitable for new applications requiring collision resistance.

However, SHA-256 should not be used on its own for password storage. Because it is designed to compute hashes quickly, attackers can efficiently test large numbers of password guesses. For password storage, use a dedicated password-hashing algorithm such as Argon2id, bcrypt, or scrypt.

SHA-256 vs. SHA-1

Both SHA-256 and SHA-1 are cryptographic hash functions, but they differ in hash length and security. SHA-256 produces a longer hash and provides stronger protection against collision attacks.

Feature SHA-256 SHA-1
Hash length 256 bits / 64 hexadecimal characters 160 bits / 40 hexadecimal characters
Security status Secure for general-purpose cryptographic hashing Deprecated; practical collisions exist
Recommended use Digital signatures, certificates, integrity checks, and general hashing Legacy compatibility only

How to use this calculator

Hashing Text

  1. Type or paste your string into the Input text area.
  2. The 64-character SHA-256 hash updates instantly in real time.
  3. Select Copy SHA-256 hash to copy the hash output directly to your clipboard.

Hashing Hex or Base64 bytes

To hash raw bytes instead of text, change Input type to Hex or Base64 and paste the encoded value. The input is decoded to bytes first, and the SHA-256 hash is calculated from those bytes.

  • Hex accepts values such as 48656c6c6f, 48 65 6c 6c 6f, or 0x48 0x65 0x6c 0x6c 0x6f.
  • Base64 accepts standard and URL-safe Base64, with or without = padding.

Hashing Files

  1. Drag and drop any file directly into the file drop zone, or click to browse files from your device.
  2. The browser computes the SHA-256 file checksum client-side.
  3. Select Copy SHA-256 hash to copy the resulting hash.

The whole file is loaded into your browser's memory for hashing, so very large files, such as multi-gigabyte disk images, may be slow or fail. For those, a command-line tool such as sha256sum or certutil -hashfile file SHA256 on Windows is more reliable.

Verifying a download

  1. Drop the downloaded file into the file drop zone.
  2. Turn on the Verify hash switch below the SHA-256 hash.
  3. Copy the SHA-256 hash published by the provider, usually on the download page or in a SHA256SUMS file, and paste it into Expected hash.
  4. A green ✅ Hashes match message confirms the file matches the published hash. A red ❌ Hashes do not match means the file differs from the published one, so download it again from the official source.

Security note: Always obtain the expected checksum from a trusted source. A matching hash does not prove that a downloaded file is safe or authentic if the checksum itself has been compromised.

The expected hash can be pasted in upper or lower case, with spaces, as a whole line from a checksum file such as 2cf24dba…9824 file.iso, or as Base64. If you paste a hash from a different algorithm, such as SHA-1 or SHA-512, the calculator tells you instead of reporting a mismatch.

Prefilling the calculator with URL parameters

Add parameters to the page address to open the calculator with input and settings already filled in, for example in documentation or a bug report. For example, /tools/sha256-hash-calculator?input=hello&enc=text opens the calculator with the hash of hello. Don't put passwords or other sensitive text in these links: anything in a page address can end up in browser history and server logs, and it is shared along with the link.

Parameter Example Behavior
input hello Prefills the input
enc text, hex, base64 Sets the input type
uppercase 1 or 0 Shows the hash in uppercase or lowercase
base64 1 or 0 Shows the hash as Base64 or Hex
expected 2cf24dba… Turns on Verify hash and fills in the expected hash

Parameters override the settings remembered from your last visit, and the settings they set are remembered in the same way. Encode special characters in values: a space as %20, and + as %2B, which matters for Base64 input.

SHA-256 test examples

Use these values to check that this calculator, or any other SHA-256 tool, gives the expected result. Select Try to load an example into the calculator above.

Input Input type SHA-256 hash Try
hello Text 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
68656c6c6f Hex 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
aGVsbG8= Base64 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
Hello Text 185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969
hello followed by Enter Text 5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03
hello 😀 Text 701734ab010f0b6dbb1cd1ce3c474b226d1abff267affc16c2bfd6ba1bb52396
68656c6c6f20f09f9880 Hex 701734ab010f0b6dbb1cd1ce3c474b226d1abff267affc16c2bfd6ba1bb52396

The first three rows are the same five bytes written as text, Hex, and Base64, so they produce the same hash. A single uppercase letter or a trailing newline produces a completely different hash. This is why echo hello | sha256sum returns the "followed by Enter" value: echo adds a newline. Use printf hello | sha256sum to hash the text without it.

The last two rows show the UTF-8 conversion. The 😀 emoji is encoded as 4 bytes in UTF-8 (f0 9f 98 80), so hello 😀 is 10 bytes, not 7 characters. Pasting those bytes as Hex gives the same hash. Tools that encode text differently, for example as UTF-16, produce a different hash for the same characters.

How your input is processed

A hash is calculated from bytes, not characters, so knowing how your input becomes bytes helps when comparing results with other tools:

  • Text is encoded as UTF-8 before hashing. This matches common tools such as sha256sum, openssl dgst -sha256, and Python's hashlib when they hash UTF-8 text.
  • Hex and Base64 input is decoded to the exact bytes it represents.
  • Files are hashed byte for byte, exactly as stored, without any text conversion.
  • Every character counts. Spaces, a trailing newline, and line endings all change the hash. Text typed into the browser uses LF (\n) line endings, so text copied from a Windows file that uses CRLF (\r\n) will not match that file's hash. Hash the file itself instead.

All processing happens locally in your browser. Your text and files are never uploaded, and this site does not save your input text. The input field also asks browsers not to keep it, but some may still restore it, for example when you go back to the page or reopen a closed tab. Only display settings, such as the input type and output format, are remembered.

Calculate SHA-256 in the command line

SHA-256 checksums can be calculated using built-in tools on Linux, macOS, and Windows. The commands below demonstrate how to hash files and verify checksums.

For text input, hello without a trailing newline produces the SHA-256 hash 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824.

Linux

# Hash a file
sha256sum file.iso

# Check files against a published checksum file
sha256sum -c SHA256SUMS --ignore-missing

# Hash text without a trailing newline
printf 'hello' | sha256sum

macOS

# Hash a file
shasum -a 256 file.iso

# Check files against a published checksum file
shasum -a 256 -c SHA256SUMS

# Hash text without a trailing newline
printf 'hello' | shasum -a 256

Windows

# PowerShell
Get-FileHash file.iso -Algorithm SHA256

# Command Prompt
certutil -hashfile file.iso SHA256

PowerShell prints the hash in uppercase. Hex hashes are not case-sensitive, so you can paste it into Verify hash as it is.

OpenSSL (any platform)

openssl dgst -sha256 file.iso

Calculate SHA-256 in code

JavaScript (browser and Node.js)

The Web Crypto API is built into modern browsers and Node.js, and it is what this calculator uses:

async function sha256(text) {
  const bytes = new TextEncoder().encode(text);
  const hash = await crypto.subtle.digest('SHA-256', bytes);
  return Array.from(new Uint8Array(hash), b => b.toString(16).padStart(2, '0')).join('');
}

console.log(await sha256('hello'));
// 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

Node.js

import { createHash } from 'node:crypto';
import { createReadStream } from 'node:fs';

// Text
console.log(createHash('sha256').update('hello').digest('hex'));

// File, read in chunks so large files don't need to fit in memory
const hash = createHash('sha256');
for await (const chunk of createReadStream('file.iso')) hash.update(chunk);
console.log(hash.digest('hex'));

Python

import hashlib

# Text
print(hashlib.sha256('hello'.encode('utf-8')).hexdigest())

# File (Python 3.11+)
with open('file.iso', 'rb') as f:
    print(hashlib.file_digest(f, 'sha256').hexdigest())

PHP

<?php
// Text
echo hash('sha256', 'hello');

// File
echo hash_file('sha256', 'file.iso');

All of these examples hash text as UTF-8 bytes, like this calculator, so they produce the same hashes for the same input.

Frequently asked questions

Are my files or text uploaded to your server?

No. All hashes are calculated locally in your browser, and your input text is not saved. See how your input is processed.

Can SHA-256 be reversed?

No. SHA-256 is a one-way hash function, so the original input cannot feasibly be calculated from its hash alone. However, common or predictable inputs can still be discovered by guessing possible values and comparing their hashes.

Can two different inputs produce the same SHA-256 hash?

Yes. This is called a collision. Because SHA-256 produces a fixed-length hash, collisions must exist mathematically. However, no practical collision attack against the full SHA-256 algorithm is currently known.

Why do different SHA-256 calculators sometimes produce different hashes?

The input bytes differ, usually because of capitalization, spaces, a trailing newline, line endings, or character encoding. Compare your result with the test examples and see how your input is processed.

Is SHA-256 case-sensitive? Does uppercase matter?

The input is case-sensitive: hello and Hello produce completely different hashes. The hexadecimal output is not: E3B0C442… and e3b0c442… are the same hash. This calculator shows lowercase by default, like sha256sum and certutil, and Uppercase output matches PowerShell's Get-FileHash. Verify hash accepts either case.

What is SHA-256 file checksum verification?

It confirms that a downloaded file is identical to the original by comparing its SHA-256 hash with the checksum published by the provider. Drop the file into the calculator, turn on Verify hash, and paste the expected checksum. The comparison runs locally in your browser. See verifying a download.

Cryptographic hash calculators

Security and verification

Last updated:

© 2008–2026 XORBIN.COM. All rights reserved.