diff --git a/category_encoders/binary.py b/category_encoders/binary.py
index <HASH>..<HASH> 100644
--- a/category_encoders/binary.py
+++ b/category_encoders/binary.py
@@ -118,6 +118,9 @@ class BinaryEncoder(BaseEstimator, TransformerMixin):
         )
         self.ordinal_encoder = self.ordinal_encoder.fit(X)
 
+        for col in self.cols:
+            self.digits_per_col[col] = self.calc_required_digits(X, col)
+
         # drop all output columns with 0 variance.
         if self.drop_invariant:
             self.drop_cols = []
@@ -125,8 +128,6 @@ class BinaryEncoder(BaseEstimator, TransformerMixin):
             self.drop_cols = [x for x in X_temp.columns.values if X_temp[x].var() <= 10e-5]
 
 
-        for col in self.cols:
-            self.digits_per_col[col] = self.calc_required_digits(X, col)
 
         return self
In binary.py fixed small. The number of required digits must be calculated before dropping invariant columns