Calculate MD5, SHA, and HMAC Online: Uses and Differences
Summary:Calculate MD5, SHA1, SHA256, SHA512, and HMAC for text in your browser. Understand digest lengths, API signatures, and why hashing is not encryption.

When debugging API signatures, comparing data, or integrating an SDK, it helps to calculate a text digest independently. Xian's Tools provides:

Calculations run locally in your browser without sending the input to a server.

How to use the tools

MD5: enter text and click Encrypt to obtain a 32-character lowercase hexadecimal digest. Click To Upper Case if your integration expects uppercase text.

Digest lengths

  • MD5:128 bits,由 32 个十六进制字符表示。
  • SHA1:160 bits,由 40 个十六进制字符表示。
  • SHA256:256 bits,由 64 个十六进制字符表示。
  • SHA512:512 bits,由 128 个十六进制字符表示。

Length is a useful check when you already know the expected algorithm. Some systems call characters 9–24 of a full MD5 digest a “16-character MD5”; that is a shortened representation, not a separate algorithm.

Sites advertising “MD5 decryption” usually look up previously calculated values for common inputs. For reversible encryption, see AES Encryption and Decryption.

What is HMAC?

HMAC combines a hash function with a secret key to produce a message authentication code. It is used in:

  • API signature verification, including service callbacks.
  • Webhook request authentication.
  • JWT HS256 signatures, which use HMAC-SHA256 internally.

During debugging, calculate the expected result and compare it with your program's output. This can help isolate differences in message construction or keys. A raw HMAC calculator does not construct an entire JWT or an API-specific signing payload for you.

Choosing an algorithm

  • Non-security checksums: MD5 and SHA1 may appear in older integrations; SHA256 is a stronger general choice.
  • Security-sensitive digest operations: SHA256 or SHA512, as required by the protocol.
  • API message authentication: HMAC-SHA256 is a common choice.
  • Password storage: use a dedicated salted password-hashing algorithm, such as bcrypt or Argon2, instead of plain MD5 or SHA.

MD5 and SHA1 have known collision weaknesses and should not be chosen for collision-sensitive security uses.

Frequently asked questions

Why does my result differ from someone else's?

Check extra spaces, line breaks, letter case, text encoding, and the HMAC key. Matching visible text is not enough if the underlying bytes differ.

Do uppercase and lowercase digests mean different values?

They represent the same hexadecimal bytes, but a signature comparison may require a particular letter case. Follow the receiving system's specification.

Related tools

Questions
Compress JPG and PNG Images Online Without Uploading Files
Reduce JPG and PNG file sizes in your browser. Learn how quality settings, output formats, and compression ratios affect your images.
Convert PNG to JPG and JPG to PNG Online
Convert PNG, JPG, and BMP images in your browser without uploading files. Learn how conversion affects transparency, file size, and image quality.
Crop Images Online: Aspect Ratios, Rotation, and WebP Export
Crop photos to 1:1, 16:9, and other aspect ratios. Rotate, flip, and lock your selection, then export PNG, JPG, or WebP directly in your browser.
Resize Images, View Image Information, and Create ICO Icons Online
Resize images, adjust output quality, inspect format and color space, and convert PNG or JPG to ICO icons with browser-based Image Tools.
Convert MOV to MP4, MKV to MP4, and MP4 to WebM Online
Convert videos between MP4, MKV, AVI, MOV, FLV, WebM, and M4V in your browser. Compare formats and learn what changes during conversion.
Trim and Crop Videos Online, Then Export MP4
Keep a selected video segment, remove black borders, or crop a recording to one area. Trim and crop locally in your browser and download an MP4.
Extract Audio from Video Online: Convert MP4 to MP3
Extract sound from MP4, MOV, or MKV videos and export MP3, WAV, FLAC, or M4A. Process recordings locally in your browser without uploading files.
Convert WAV, FLAC, and M4A to MP3 Online
Convert audio between MP3, WAV, FLAC, M4A, OGG, WMA, and AC3 in your browser. Compare formats and understand the tradeoffs in file size and quality.
Trim Audio Online: Cut MP3 Clips with a Waveform Preview
Select a time range on an audio waveform, listen to the preview, and export MP3. Make short clips or remove unwanted sections from recordings locally.
Generate and Read QR Codes Online from Text, Links, and Images
Create a downloadable QR code from text or a URL, or decode a QR image in your browser. Learn how to make codes easier to scan and inspect their links.
AES Encryption and Decryption Online: CBC, ECB, Keys, and IVs
Use AES-128, AES-192, or AES-256 with CBC or ECB in your browser. Check UTF-8 key lengths, IV requirements, and hex or Base64 ciphertext encoding.
Base64 and URL Encoding Online: Differences and Common Uses
Encode and decode UTF-8 text with Base64 or URL percent-encoding in your browser. Learn which to use and how to troubleshoot malformed URL escapes.
Random String Generator: Alphanumeric Test Data and Temporary IDs
Generate 1–10,000 alphanumeric characters with a letter first. Create test data and temporary identifiers, and learn why this tool is unsuitable for secrets.
Free Online Tools for Images, Video, Audio, and Encoding
Explore Xian's Tools for compression, conversion, trimming, QR codes, AES, and hashing. Learn how files are processed locally in your browser without uploads.
Compress Videos Online: MP4 Compression, Bitrate, and File Size
Compress MP4, MOV, and MKV videos locally in your browser. Learn how the quality slider changes bitrate and how to interpret the estimated output size.
Compress Audio Online: Reduce MP3 Bitrate and Recording File Size
Reduce audio file sizes locally in your browser. Learn how bitrate affects size and how to choose compression settings for speech, podcasts, and music.
Calculate MD5, SHA, and HMAC Online: Uses and Differences
Calculate MD5, SHA1, SHA256, SHA512, and HMAC for text in your browser. Understand digest lengths, API signatures, and why hashing is not encryption.