Is there any point in noting that JavaScript will do this for you?
Code:
<script type="text/javascript">
var binary = "110010111011000011101";
var number = parseInt( binary, 2 );
alert( number );
</script>
The second argument to parseInt -- the 2 -- tells JS to convert the string in radix=2. That is, in binary.
And of course you can go back the other way:
Code:
var number = 7181711;
var binary = number.toString(2);