diff --git a/src/md5sum.c b/src/md5sum.c
index f7e0849..7bf9391 100644
--- a/src/md5sum.c
+++ b/src/md5sum.c
@@ -129,13 +129,17 @@ static bool strict = false;
 /* Whether a BSD reversed format checksum is detected.  */
 static int bsd_reversed = -1;
 
+/* Whether output is binary or hexadecimal format.  */
+static bool raw_output = false;
+
 /* For long options that have no equivalent short option, use a
    non-character as a pseudo short option, starting with CHAR_MAX + 1.  */
 enum
 {
   STATUS_OPTION = CHAR_MAX + 1,
   QUIET_OPTION,
-  STRICT_OPTION
+  STRICT_OPTION,
+  RAW_OPTION
 };
 
 static struct option const long_options[] =
@@ -147,6 +151,7 @@ static struct option const long_options[] =
   { "text", no_argument, NULL, 't' },
   { "warn", no_argument, NULL, 'w' },
   { "strict", no_argument, NULL, STRICT_OPTION },
+  { "raw", no_argument, NULL, RAW_OPTION },
   { GETOPT_HELP_OPTION_DECL },
   { GETOPT_VERSION_OPTION_DECL },
   { NULL, 0, NULL, 0 }
@@ -188,6 +193,9 @@ With no FILE, or when FILE is -, read standard input.\n\
   -t, --text           read in text mode (default)\n\
 "), stdout);
       fputs (_("\
+      --raw            output in binary format (useful to use pipes)\n\
+"), stdout);
+      fputs (_("\
 \n\
 The following three options are useful only when verifying checksums:\n\
       --quiet          don't print OK for each successfully verified file\n\
@@ -690,6 +698,9 @@ main (int argc, char **argv)
       case STRICT_OPTION:
         strict = true;
         break;
+      case RAW_OPTION:
+        raw_output = true;
+        break;
       case_GETOPT_HELP_CHAR;
       case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
       default:
@@ -752,6 +763,13 @@ main (int argc, char **argv)
 
           if (! digest_file (file, &file_is_binary, bin_buffer))
             ok = false;
+          else if (raw_output)
+            {
+              size_t i;
+
+              for (i = 0; i < DIGEST_BIN_BYTES; ++i)
+                putchar(bin_buffer[i]);
+            }
           else
             {
               size_t i;
