Hash Calculator

Calculate MD5, SHA-1, SHA-256, SHA-512 of text or files. Runs locally.

Privacy First All hashing is performed entirely in your browser. No text or file content is uploaded to any server.
Input Type text or select a local file
Any file type supported
Results Hash values will appear here

Hash Calculator / 哈希计算工具

This free online hash calculator computes MD5, SHA-1, SHA-256, SHA-384 and SHA-512 digests of any text or local file — entirely in your browser. 免费在线哈希计算工具,支持 MD5、SHA-1、SHA-256、SHA-384、SHA-512,可处理文本或本地文件,所有计算在浏览器本地完成,数据不会上传。There is no upload step at all: text is hashed on your machine, and files are read directly from disk through the browser's File API.

Which algorithm should I use? / 该选哪种算法?

  • SHA-256 — the modern default. Use it for checksums, API signing, password storage (with a proper KDF), and general integrity checks.
  • SHA-512 — longer digests for large files; slightly faster on 64-bit hardware.
  • MD5 — legacy only. Not collision-resistant; fine for non-security checksums, never for passwords or verifying authenticity.
  • SHA-1 — deprecated for security purposes; keep it only for compatibility with older systems.

Hashing is one-way: it cannot be reversed, so it is ideal for comparing whether two inputs are identical, but not for recovering the original text. 哈希是单向的,无法反推原文,适合比对一致性,不适合用于恢复内容。

Common uses / 常见用途

  • Verify that a downloaded file matches the publisher's checksum (update, dataset, build artifact)
  • Generate stable IDs for deduplication — two identical inputs always produce the same hash
  • Create API signatures and HMAC-style digests for webhooks and webhooks callbacks
  • Prove content integrity in logs, backups, and version control workflows
  • Compare strings without exposing the original value in tooling or reports

Privacy / 隐私说明

All computation happens locally with the Web Crypto API and a built-in MD5 implementation. Your text and file contents never leave your device — the page works offline after the first load, and no hashes are logged or transmitted. 所有计算在本地完成,文本与文件内容不会离开设备,页面首次加载后离线可用。

FAQ / 常见问题

Q: Why do two tools give different MD5 values for the same text? / 两个工具算出的 MD5 不一样? — Check line endings (Windows \r\n vs Unix \n) and trailing spaces; MD5 is byte-exact. 请检查换行符(\r\n 与 \n)和行尾空格,MD5 精确到字节。

Q: Can I hash large files? / 能算大文件的哈希吗? — Yes. Files are read locally in chunks; several hundred MB works fine on a typical machine. 支持,本地分块读取,几百 MB 的文件也没问题。

Q: Is SHA-256 the same as SHA-512? / SHA-256 和 SHA-512 有什么区别? — Both are SHA-2 family, but SHA-256 outputs 64 hex characters and SHA-512 outputs 128. Use SHA-256 unless a system explicitly asks for 512. 输出长度不同,除非系统明确要求 512,一般选 256。

Related tools / 相关工具