String s = "1000100010000000"; int a = Integer.parseInt(s, 2);