convert binary number to integer python code example Example 1: binary to decimal python format(decimal ,"b") Example 2: bin to int python >>> int('11111111', 2) 255