icon

Convert Binary to Int in Python

Last modified: 2023-08-29

Conversion

We can convert binary to int by specifying 2 the second argument of int method in Python.

int("1101", 2)
# 13

int("11111111", 2)
# 255