Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
FREEDOM251

Freedom251 › Blog › Android Security

How to Check an APK’s SHA-256 Hash Locally in Your Browser

By Freedom251 Team · · 4 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can calculate an APK’s SHA-256 checksum in a browser without uploading the file: let the user choose the APK, read its bytes with File.arrayBuffer(), and pass the resulting buffer to crypto.subtle.digest("SHA-256", buffer). The result is a fingerprint of those exact file bytes—not a malware scan or a check of the APK’s Android signing certificate.

Build the local APK checksum page

Save this as an HTML file and serve it from a secure context, such as an HTTPS site or localhost. The file extension is only a selection hint; choosing a file ending in .apk does not establish that its contents are a valid APK.

As an Amazon Associate I earn from qualifying purchases.

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Local APK SHA-256 checker</title>
<h1>Local APK SHA-256 checker</h1>
<p>This page hashes the selected file in your browser. It does not upload the file, scan for malware, or verify an APK signature.</p>
<label for="apk">Choose APK</label>
<input id="apk" type="file" accept=".apk,application/vnd.android.package-archive">
<label for="expected">Expected SHA-256 (optional)</label>
<input id="expected" type="text" spellcheck="false" autocomplete="off">
<button id="copy" type="button" disabled>Copy SHA-256</button>
<p id="status" role="status" aria-live="polite">Choose a file to calculate its SHA-256 checksum.</p>
<p>File: <span id="filename">None</span></p>
<p>Algorithm: SHA-256</p>
<p>SHA-256: <code id="digest">—</code></p>
<p id="comparison"></p>
<script>
const apkInput = document.querySelector("#apk");
const expectedInput = document.querySelector("#expected");
const status = document.querySelector("#status");
const filename = document.querySelector("#filename");
const digestOutput = document.querySelector("#digest");
const comparison = document.querySelector("#comparison");
const copyButton = document.querySelector("#copy");
let currentDigest = "";

function compareExpected() {
  const expected = expectedInput.value.trim();
  if (!currentDigest || !expected) {
    comparison.textContent = "";
  } else if (!/^[0-9a-f]{64}$/i.test(expected)) {
    comparison.textContent = "Enter a 64-character hexadecimal SHA-256 value to compare.";
  } else {
    comparison.textContent = expected.toLowerCase() === currentDigest
      ? "Match: the selected file has this SHA-256 value."
      : "No match: the selected file has a different SHA-256 value.";
  }
}

expectedInput.addEventListener("input", compareExpected);
copyButton.addEventListener("click", async () => {
  try {
    await navigator.clipboard.writeText(currentDigest);
    status.textContent = "SHA-256 copied.";
  } catch {
    status.textContent = "Copy failed. Select and copy the displayed SHA-256 value.";
  }
});

apkInput.addEventListener("change", async () => {
  const file = apkInput.files[0];
  currentDigest = "";
  digestOutput.textContent = "—";
  comparison.textContent = "";
  copyButton.disabled = true;
  filename.textContent = file ? file.name : "None";
  if (!file) {
    status.textContent = "Choose a file to calculate its SHA-256 checksum.";
    return;
  }
  if (!globalThis.crypto?.subtle || typeof file.arrayBuffer !== "function") {
    status.textContent = "SHA-256 is unavailable here. Use a supported browser in a secure context, such as HTTPS or localhost.";
    return;
  }
  status.textContent = "Reading file and calculating SHA-256…";
  try {
    const buffer = await file.arrayBuffer();
    const hash = await crypto.subtle.digest("SHA-256", buffer);
    currentDigest = Array.from(new Uint8Array(hash), byte =>
      byte.toString(16).padStart(2, "0")
    ).join("");
    digestOutput.textContent = currentDigest;
    copyButton.disabled = false;
    status.textContent = "SHA-256 calculated locally in this page.";
    compareExpected();
  } catch {
    status.textContent = "Could not read or hash this file. Try selecting it again.";
  }
});
</script>
</html>

What the code does

  1. The file input gives the page a user-selected File. Its name is displayed, but the extension is not treated as proof of file type.
  2. file.arrayBuffer() reads the file bytes, and crypto.subtle.digest("SHA-256", buffer) calculates the digest. The Web Crypto digest API needs the complete input in memory rather than processing it as a stream, so large files can require substantial memory. MDN documents the full-buffer requirement and secure-context constraint.
  3. The digest is returned as binary data. The code converts each byte to two lowercase hexadecimal characters, preserving leading zeroes, then displays the result and enables copying.
  4. If an expected checksum is entered, the page trims surrounding whitespace, validates a 64-character hexadecimal value, and compares without regard to letter case.

Understand what a checksum match proves

A SHA-256 comparison answers whether the selected file’s bytes produce the same digest as the expected value. It does not identify who created the APK, establish that the file is safe, or validate Android’s APK-signing scheme. The comparison is useful only when the expected checksum comes from a source you trust; a checksum taken from the same untrusted download channel does not establish the file’s origin. MDN’s file-checksum example uses the same general read-bytes, digest, and convert-to-hex workflow.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Android’s tool to verify an APK signature

If the question is whether an APK’s Android signature verifies, use Android SDK Build Tools’ apksigner, not a browser checksum page. With the APK available as app.apk, run:

#1 Best Overall
Yubico - Security Key C NFC - Basic Compatibility - Multi-Factor authentication (MFA) Security Key and passkey, Connect via USB-C or NFC, FIDO Certified
  • POWERFUL SECURITY KEY: The Security Key C NFC is the essential physical passkey for protecting your digital life from phishing attacks. It ensures only you can access your accounts.
  • WORKS WITH 1000+ ACCOUNTS: Compatible with Google, Microsoft, and Apple. A single Security Key C NFC secures 100 of your favorite accounts, including email, password managers, and more.
  • FAST & CONVENIENT LOGIN: Plug in your Security Key C NFC via USB-C and tap it, or tap it against your phone (NFC) to authenticate. No batteries, no internet connection, and no extra fees required.
  • TRUSTED PASSKEY TECHNOLOGY: Uses the latest passkey standards (FIDO2/WebAuthn & FIDO U2F) but does not support One-Time Passwords. For complex needs, check out the YubiKey 5 Series.
  • BUILT TO LAST: Made from tough, waterproof, and crush-resistant materials. Manufactured in Sweden and programmed in the USA with the highest security standards.
apksigner verify --print-certs app.apk

Android documents apksigner verify for checking whether an APK signature verifies on the Android platform versions the APK supports; --print-certs displays signer certificate information. See the Android Developers apksigner documentation. Android also warns that modifying an APK after signing invalidates its signature.

Best Value
FIDO2 U2F Security Key Passkey Two-Factor Authentication (2FA) USB Key PIN+Touch (Non-Biometric) USB-A Type TrustKey T110
  • Security Key : Protect your online accounts against unauthorized access by using FIDO2 and U2F authentication with T110. It's the world's most protective security key that works with windows, Mac OS, Linux as well as Chrome, Firefox, Edge and many other major browsers.
  • Certified with the new FIDO2 standard, T110 provides the benefit of fast login and strong protection against phishing, account takeover as well as many other online attactks.
  • Works with : Bank of America, Github, Google, Microsoft, DUO, Twitter, Facebook, Dropbox, Apple, ebay, BINANCE, mor and more.
  • Fits USB-A port : Insert the T110 security key into the USB-A port of each service and log in conveniently with one touch
  • For the driver download and user guide, please visit TrustKey Solutions Home support page.
Rank #4
Yubico - Security Key NFC - Basic Compatibility - Multi-Factor Authentication (MFA) Key, Connect via USB-A or NFC, FIDO Certified
  • POWERFUL SECURITY KEY: The Security Key NFC is the essential physical passkey for protecting your digital life from phishing attacks. It ensures only you can access your accounts.
  • WORKS WITH 1000+ ACCOUNTS: Compatible with Google, Microsoft, and Apple. A single Security Key NFC secures 100 of your favorite accounts, including email, password managers, and more.
  • FAST & CONVENIENT LOGIN: Plug in your Security Key NFC via USB-A and tap it, or tap it against your phone (NFC) to authenticate. No batteries, no internet connection, and no extra fees required.
  • TRUSTED PASSKEY TECHNOLOGY: Uses the latest passkey standards (FIDO2/WebAuthn & FIDO U2F) but does not support One-Time Passwords. For complex needs, check out the YubiKey 5 Series.
  • BUILT TO LAST: Made from tough, waterproof, and crush-resistant materials. Manufactured in Sweden and programmed in the USA with the highest security standards.
Rank #3
Yubico - YubiKey 5 NFC - Multi-Factor authentication (MFA) Security Key and passkey, Connect via USB-A or NFC, FIDO Certified - Protect Your Online Accounts
  • POWERFUL SECURITY KEY: The YubiKey 5 NFC is the most versatile physical passkey, protecting your digital life from phishing attacks. It ensures only you can access your accounts
  • WORKS WITH 1000+ ACCOUNTS: Compatible with popular accounts like Google, Microsoft, and Apple. A single YubiKey 5 NFC secures 100+ of your favorite accounts, including email, password managers, and more
  • FAST & CONVENIENT LOGIN: Plug in your YubiKey 5 NFC via USB and tap it, or tap it against your phone (NFC), to authenticate. No batteries, no internet connection, and no extra fees required
  • MOST SECURE PASSKEY: Supports FIDO2/WebAuthn, FIDO U2F, Yubico OTP, OATH-TOTP/HOTP, Smart card (PIV), and OpenPGP. That means it’s versatile, working almost anywhere you need it
  • PRIMARY & SPARE KEYS: Just like having a spare house key, we recommend buying two YubiKeys - one for daily use and one as a spare. That way you’ll never get locked out of your accounts
Rank #2
Yubico - YubiKey 5C NFC - Multi-Factor authentication (MFA) Security Key and passkey, Connect via USB-C or NFC, FIDO Certified - Protect Your Online Accounts
  • POWERFUL SECURITY KEY: The YubiKey 5C NFC is the most versatile physical passkey, protecting your digital life from phishing attacks. It ensures only you can access your accounts
  • WORKS WITH 1000+ ACCOUNTS: Compatible with popular accounts like Google, Microsoft, and Apple. A single YubiKey 5C NFC secures 100+ of your favorite accounts, including email, password managers, and more
  • FAST & CONVENIENT LOGIN: Plug in your YubiKey 5C NFC via USB and tap it, or tap it against your phone (NFC), to authenticate. No batteries, no internet connection, and no extra fees required
  • MOST SECURE PASSKEY: Supports FIDO2/WebAuthn, FIDO U2F, Yubico OTP, OATH-TOTP/HOTP, Smart card (PIV), and OpenPGP. That means it’s versatile, working almost anywhere you need it
  • PRIMARY & SPARE KEYS: Just like having a spare house key, we recommend buying two YubiKeys - one for daily use and one as a spare. That way you’ll never get locked out of your accounts
Workflow What it checks What you need Evidence it produces
Browser SHA-256 comparison Whether the exact selected file bytes match a known digest A browser supporting Web Crypto and a checksum obtained through a trusted channel A hexadecimal digest and, if supplied, a match or mismatch
apksigner verify Whether the APK’s Android signature verifies Android SDK Build Tools with apksigner and the APK file Signature verification result; --print-certs also displays certificate data

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Android SecurityAPKJavaScriptSHA-256Web Crypto

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.