This question already has an answer here:

Input text: test

  • Online MD5 hashsum generator: 098f6bcd4621d373cade4e832627b4f6
  • echo "test" | md5sum: d8e8fca2dc0f896fd7cb4cb0031ba249

Also the same happens to sha512sum and sha1sum.

Why does Linux and an online generator generate different hashes?

marked as duplicate by steeldriver, Michael Homer, sebasth, Rui F Ribeiro, Jeff Schaller Nov 10 '18 at 22:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


One of these is the hash of "test" and one of them is the hash of "test\n".

$ printf 'test' | md5sum
098f6bcd4621d373cade4e832627b4f6  -
$ printf 'test\n' | md5sum
d8e8fca2dc0f896fd7cb4cb0031ba249  -

echo outputs a newline character after its arguments.

Not the answer you're looking for? Browse other questions tagged or ask your own question.