# How the binary translator works

In order to understand how binary translation works, or how letters are converted into a series of ones and zeros (binary or base two), a quick introduction to how computers function is useful.

All digital computers (analog computers also exist), from the most powerful mainframe to the smallest personal computer, as well as all phones, calculators and digital devices which perform any form of calculation, at their heart work using logic gates. Logic gates only have two possible states and can these can either be on or off.

On and off, giving us the binary states of one and zero.

Many years ago (starting with the Manchester Mark 4), these logic gates were composed of valves. Technology moved on and valves were replaced by transistors. There have been further shifts with integrated circuits and surface mounted technology but fundamentally deep down at the level of logic, nothing has changed.

Technology whether it be powered by values, or integrated cirucits is used to create logic gates, which are binary systems.

So, these switches, can either be on or off, which equate to the digits one and zero, and can be used to count.

We count using decimal, and because we all know how to do this, don't really think about how it works, or why for example there are nine numbers, and not say sixteen, eight or perhaps two.

There are two stages to a binary translator. Firstly, the letters need to be converted into numbers, and secondly the numbers need to be converted into binary.

Every alphabetic, numeric, and character that can be displayed on a computer screen has a corresponding is represented with a number defined by a universally known and understood format. There is more than one format.

ASCII (American Standard Code for Information Interchange) is the most common format for text files.
There is a more modern system known as UNICODE which allows a greater range of characters to be displayed, but is is not used in this binary to text translator.

In the programming world, 'Hello world' is often used when writing a demonstration program to show that a piece of hardware is working, "Hello world' translated into binary is:

01101000 01100101 01101100 01101100 01101111 00100000 01110111 01101111 01110010 01101100 01100100

Another example, is 'SurfaceLanguages' which translated into binary gives :

01110011 01110101 01110010 01100110 01100001 01100011 01100101 00100000 01101100 01100001 01101110 01100111 01110101 01100001 01100111 01100101 01110011

Surfacelanguages' in binary is 128 characters long and 'Hello world' has a length of 80 characters, which goes some way to explaining why humans don't use it very often.

And if you have made it this far, here is a rather more detailed explanation of how to translate text into binary. For simplicity, we'll convert '123' into binary, but exactly the same principle is used to translate ascii or unicode text into binary.

The numbers zero to ten in binary are:

0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010

The numbers one to ten in ascii are

48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60

Essentially all that has to be done is to match the ascii number to the corresponding binary value.

And so we have:

1 10 11

There is one final step necessary, and that is we need to ensure that all the binary numbers have the same length otherwise when translating the binary back into characters or numbers confusion would arise.

Using our example of '123' the meaning of which is obvious in decimal, but (without the spaces) would be 11011 in binary which would be 27 in decimal.

The binary translator on this page ensures that each binary 'number' is eight digits long giving us (for 123):-

00000001 00000010 00000011 and so on.

The reason for this, for the real geeks out there, is that the maximum value of any character using the ASCII system (included the extended ASCII codes)is 255 which conveniently in binary is:

11111111

##### I love you in binary is

01101001 00100000 01101100 01101111 01110110 01100101 00100000 01111001 01101111 01110101

And if you really need to shout it is ...

01001001 00100000 01001100 01001111 01010110 01000101 00100000 01011001 01001111 01010101

That was a bit of a geeky joke.

So if you can't read binary code, then cut and paste it, put it into the translator and get the binary translation.