This will convert your text into binary text.
Computers do not understand what human language is. Machines only really understands 1's and 0's, and so we must
speak to it with 1's and 0's. In computing a 1 or 0 is generally the smallest way to represent information and we call it a bit. A bit can simply represented by a 0 or 1.
A single bit of information can only represent 2 states 0 and 1.
If we put 2 bits together we can represent 4 different states 00, 01, 10 and 11.
If we put 3 bits together we can represent 8 different states 000,001,010,011,010,100,101,110,111.
If we put 8 bits toether we call that a byte. A byte can represent 2^8 or 256 states, and this is really useful because a computer knows all about bits and bytes but not human letters.
Because it is hard for humans to read a bunch of ones and zeros; we translate what the machine is displaying with a mapping called ASCII Table.
For example if we are to look at the symbol X(capital x) we can see in the ASCII mapping that the machine knows X as the decimal number 88, and that 88 in binary is 1011000. Try it for yourself below!
<html>
<head>
<script>
</script>
</head>
<body>
</body>
</html>
Enter your word(s) to be converted here
<br/>
<textarea id="txtInput" rows="4" style="width:100%"></textarea>
<br/>
<input type="button" value="Convert Your Word(s) To Binary Code!" onclick="convert();" style="width:100%;height:40px" />
<br/> Binary Output
<br/>
<textarea id="txtOutput" rows="4" style="width:100%"></textarea>
function convert() {
//Get user's input and put it into the variable inputText
var inputText = document.getElementById("txtInput").value;
var outputText = "";
//Convert inputText into binary ascii
for (var i = 0; i < inputText.length; i++) {
outputText += inputText[i].charCodeAt(0).toString(2) + \" \";
}
//write the results to the output element named txtOutput
document.getElementById("txtOutput").value = outputText;
}