For this , In C++ you can use itoa () function .This function convert any Decimal integer to binary , decimal , hexadecimal and octal number. #include using namespace std; The question is about converting a string of decimal digits to binary . There is no decimal in this answer. You are just converting a binary integer to printable binary . Between your title and body you conflate the idea of " binary " and the idea of a "floating point representation." Floating point is a way of expressing decimal numbers in a fixed number of binary digits at the cost of precision. Binary is just a different base for counting and can express any number decimal can, given an infinite number of digits. 0 Slightly modified conventional binary conversion algorithm utilizing some more ES6 syntax and auto-features: Convert binary sequence string to Array (assuming it wasnt already passed as array) Reverse sequence to force 0 index to start at right-most binary digit as binary is calculated right-left