diff --git a/src/xxd/xxd.c b/src/xxd/xxd.c
index 1ba2247..56fb321 100644
--- a/src/xxd/xxd.c
+++ b/src/xxd/xxd.c
@@ -57,6 +57,7 @@
  * 14.01.2022  Disable extra newlines with -c0 -p by Erik Auerswald.
  * 20.06.2022  Permit setting the variable names used by -i by David Gow
  * 31.08.2023  -R never/auto/always prints colored output
+ * 06.10.2023  enable -r -b to reverse bit dumps
  *
  * (c) 1990-1998 by Juergen Weigert (jnweiger@gmail.com)
  *
@@ -135,7 +136,7 @@
 # endif
 #endif
 
-char version[] = "xxd 2023-09-04 by Juergen Weigert et al.";
+char version[] = "xxd 2023-10-06 by Juergen Weigert et al.";
 #ifdef WIN32
 char osver[] = " (Win32)";
 #else
@@ -234,7 +235,7 @@
   fprintf(stderr, "    or\n       %s -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]\n", pname);
   fprintf(stderr, "Options:\n");
   fprintf(stderr, "    -a          toggle autoskip: A single '*' replaces nul-lines. Default off.\n");
-  fprintf(stderr, "    -b          binary digit dump (incompatible with -ps,-i,-r). Default hex.\n");
+  fprintf(stderr, "    -b          binary digit dump (incompatible with -ps,-i). Default hex.\n");
   fprintf(stderr, "    -C          capitalize variable names in C include file style (-i).\n");
   fprintf(stderr, "    -c cols     format <cols> octets per line. Default 16 (-i: 12, -ps: 30).\n");
   fprintf(stderr, "    -E          show characters in EBCDIC. Default ASCII.\n");
@@ -325,6 +326,17 @@
 }
 
 /*
+ * If "c" is a bin digit, return the value.
+ * Otherwise return -1.
+ */
+  static int
+parse_bin_digit(int c)
+{
+  return (c >= '0' && c <= '1') ? c - '0'
+        : -1;
+}
+
+/*
  * Ignore text on "fpi" until end-of-line or end-of-file.
  * Return the '\n' or EOF character.
  * When an error is encountered exit with an error message.
@@ -352,7 +364,7 @@
   int hextype,
   long base_off)
 {
-  int c, ign_garb = 1, n1 = -1, n2 = 0, n3, p = cols;
+  int c, ign_garb = 1, n1 = -1, n2 = 0, n3, p = cols, bt, b = 0, bcnt = 0;
   long have_off = 0, want_off = 0;
 
   rewind(fpi);
@@ -368,25 +380,60 @@
       if (hextype == HEX_POSTSCRIPT && (c == ' ' || c == '\n' || c == '\t'))
 	continue;
 
-      n3 = n2;
-      n2 = n1;
+      if (hextype == HEX_NORMAL || hextype == HEX_POSTSCRIPT)
+        {
+	  n3 = n2;
+	  n2 = n1;
 
-      n1 = parse_hex_digit(c);
-      if (n1 == -1 && ign_garb)
-	continue;
+	  n1 = parse_hex_digit(c);
+	  if (n1 == -1 && ign_garb)
+	    continue;
+        }
+      else /* HEX_BITS */
+        {
+	  n1 = parse_hex_digit(c);
+	  if (n1 == -1 && ign_garb)
+	    continue;
+
+          bt = parse_bin_digit(c);
+          if (bt != -1)
+            {
+              b = ((b << 1) | bt);
+              ++bcnt;
+            }
+        }
 
       ign_garb = 0;
 
-      if (!hextype && (p >= cols))
+      if ((hextype != HEX_POSTSCRIPT) && (p >= cols))
 	{
-	  if (n1 < 0)
-	    {
-	      p = 0;
-	      continue;
-	    }
-	  want_off = (want_off << 4) | n1;
-	  continue;
-	}
+          if (hextype == HEX_NORMAL)
+            {
+	      if (n1 < 0)
+	        {
+	          p = 0;
+	          continue;
+	        }
+	      want_off = (want_off << 4) | n1;
+            }
+          else /* HEX_BITS */
+            {
+              n1 = parse_hex_digit(c);
+              if (n1 >= 0)
+                {
+                  want_off = (want_off << 4) | n1;
+                }
+
+              if (bt < 0)
+                {
+                  p = 0;
+                  bcnt = 0;
+                  b = 0;
+                  continue;
+                }
+            }
+          continue;
+        }
 
       if (base_off + want_off != have_off)
 	{
@@ -402,23 +449,40 @@
 	    putc_or_die(0, fpo);
 	}
 
-      if (n2 >= 0 && n1 >= 0)
-	{
-	  putc_or_die((n2 << 4) | n1, fpo);
-	  have_off++;
-	  want_off++;
-	  n1 = -1;
-	  if (!hextype && (++p >= cols))
-	    /* skip the rest of the line as garbage */
-	    c = skip_to_eol(fpi, c);
-	}
-      else if (n1 < 0 && n2 < 0 && n3 < 0)
-        /* already stumbled into garbage, skip line, wait and see */
-	c = skip_to_eol(fpi, c);
+      if (hextype == HEX_NORMAL || hextype == HEX_POSTSCRIPT)
+        {
+          if (n2 >= 0 && n1 >= 0)
+            {
+              putc_or_die((n2 << 4) | n1, fpo);
+              have_off++;
+              want_off++;
+              n1 = -1;
+              if (!hextype && (++p >= cols))
+              /* skip the rest of the line as garbage */
+              c = skip_to_eol(fpi, c);
+            }
+          else if (n1 < 0 && n2 < 0 && n3 < 0)
+            /* already stumbled into garbage, skip line, wait and see */
+            c = skip_to_eol(fpi, c);
+        }
+      else /* HEX_BITS */
+        {
+          if (bcnt == 8)
+            {
+              putc_or_die(b, fpo);
+              have_off++;
+              want_off++;
+              b = 0;
+              bcnt = 0;
+              if (++p >= cols)
+                /* skip the rest of the line as garbage */
+                 c = skip_to_eol(fpi, c);
+            }
+        }
 
       if (c == '\n')
 	{
-	  if (!hextype)
+	  if (hextype == HEX_NORMAL || hextype == HEX_BITS)
 	    want_off = 0;
 	  p = cols;
 	  ign_garb = 1;
@@ -847,12 +911,17 @@
     }
 
   if (revert)
-    {
-      if (hextype && (hextype != HEX_POSTSCRIPT))
-	error_exit(-1, "Sorry, cannot revert this type of hexdump");
-      return huntype(fp, fpo, cols, hextype,
-		negseek ? -seekoff : seekoff);
-    }
+    switch (hextype)
+      {
+      case HEX_NORMAL:
+      case HEX_POSTSCRIPT:
+      case HEX_BITS:
+        return huntype(fp, fpo, cols, hextype,
+          negseek ? -seekoff : seekoff);
+        break;
+      default:
+        error_exit(-1, "Sorry, cannot revert this type of hexdump");
+      }
 
   if (seekoff || negseek || !relseek)
     {
