
MorsePad is a Morse code site, so further down you will also find how binary compares with Morse. Both are two-state codes, and Morse can be written out as ones and zeros too, with one big difference in how the two mark where a letter ends.
How to use the binary translator
Type or paste into either box. The other box updates as you go, so there is no convert button.
- To convert text to binary, type in the Text box. "Hi" becomes 01001000 01101001.
- To convert binary to text, paste the 0s and 1s into the Binary box. You can separate the bytes with spaces or paste one long unbroken string, which the tool splits every 8 bits (or every 7 in 7-bit mode).
- Pick an encoding. 8-bit (UTF-8) handles every character, including accented letters, other alphabets and emoji. 7-bit (ASCII) writes each character with seven digits and only covers basic English letters, digits and punctuation.
- Use the Space between bytes option to split the output into readable groups, or turn it off when you need one continuous string.
- Copy binary copies the result, Share link lets you pass the text conversion on, and Clear empties both boxes.
Share links restore the text in default 8-bit mode with spaces between bytes; they do not save the encoding or spacing options.
The Hexadecimal and Decimal readouts show the same bytes in base 16 and base 10. For "Hi" they read 48 69 and 72 105. Programmers usually work in hex, so it is the quickest way to compare your output with code or a byte dump.
How text becomes binary
Computers store every character as a number. In ASCII and UTF-8, capital A is 65, lowercase a is 97 and a space is 32. A binary translator writes those numbers in base 2, which uses only the digits 0 and 1.
Each 0 or 1 is a bit, and eight bits make a byte. A byte can hold any whole number from 0 to 255. Reading from left to right, the eight positions in a byte are worth 128, 64, 32, 16, 8, 4, 2 and 1. To get the number, add up the positions that hold a 1.
| Place value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | Total |
|---|---|---|---|---|---|---|---|---|---|
| A | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 65 |
| H | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 72 |
| i | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 105 |
For A, only the 64 and the 1 are switched on, and 64 + 1 = 65. To go the other way, take the character's number, find the largest place value that fits, put a 1 there and carry on with what is left. H is 72: 64 fits and leaves 8, and 8 fits exactly, so H is 01001000.
ASCII and UTF-8
Most binary examples you see online are based on ASCII. It was first published in 1963 and had a major revision in 1967. It defines 128 codes, numbered 0 to 127: 95 printable characters (English letters, digits, punctuation and the space) and 33 control codes such as tab and line feed. 128 values fit in 7 bits, so ASCII is a 7-bit code. Computers store it in 8-bit bytes with the extra leading bit set to 0, which is why every ASCII character in 8-bit binary starts with 0.
UTF-8 is the encoding used on almost every website today; W3Techs reports about 99% of sites whose character encoding it can identify. Its first 128 codes are identical to ASCII, so plain English text produces exactly the same bytes in both. Any character outside ASCII takes two, three or four bytes.
| Code points | Bytes | Covers | Example | UTF-8 binary |
|---|---|---|---|---|
| 0 to 127 | 1 | ASCII | A | 01000001 |
| 128 to 2,047 | 2 | Accented Latin, Greek, Cyrillic, Hebrew, Arabic | é | 11000011 10101001 |
| 2,048 to 65,535 (excluding surrogates) | 3 | Most Chinese, Japanese and Korean characters, symbols like € | € | 11100010 10000010 10101100 |
| 65,536 to 1,114,111 | 4 | Most emoji, historic scripts | 😀 | 11110000 10011111 10011000 10000000 |
The first bits of each byte tell a decoder how to read it. A byte starting with 0 is a complete ASCII character. A byte starting with 110, 1110 or 11110 begins a character that is two, three or four bytes long, and a byte starting with 10 continues the character before it. That is how a UTF-8 decoder can tell an accented letter apart from plain ASCII without any separators.
Emoji sizes vary a lot. 😀 takes four bytes, but the plain heart ❤ takes three. The red heart ❤️ that phones usually send is the heart plus an invisible variation selector, so it takes six. A thumbs up with a skin tone, 👍🏽, is a thumbs up followed by a skin tone modifier and takes eight.
Binary alphabet: letters and digits in binary
ASCII letters follow a pattern you can learn in a minute. Every capital letter starts with 010, and the last five bits give its position in the alphabet: A is 01000001 (position 1), B is 01000010 (2) and Z is 01011010 (26). Lowercase letters start with 011 instead, so a capital and its lowercase partner differ by one bit, the one worth 32. Digits start with 0011, and the last four bits are the digit itself, so 5 is 00110101.
| Letter | Code | Binary | Letter | Code | Binary |
|---|---|---|---|---|---|
| A | 65 | 01000001 | a | 97 | 01100001 |
| B | 66 | 01000010 | b | 98 | 01100010 |
| C | 67 | 01000011 | c | 99 | 01100011 |
| D | 68 | 01000100 | d | 100 | 01100100 |
| E | 69 | 01000101 | e | 101 | 01100101 |
| F | 70 | 01000110 | f | 102 | 01100110 |
| G | 71 | 01000111 | g | 103 | 01100111 |
| H | 72 | 01001000 | h | 104 | 01101000 |
| I | 73 | 01001001 | i | 105 | 01101001 |
| J | 74 | 01001010 | j | 106 | 01101010 |
| K | 75 | 01001011 | k | 107 | 01101011 |
| L | 76 | 01001100 | l | 108 | 01101100 |
| M | 77 | 01001101 | m | 109 | 01101101 |
| N | 78 | 01001110 | n | 110 | 01101110 |
| O | 79 | 01001111 | o | 111 | 01101111 |
| P | 80 | 01010000 | p | 112 | 01110000 |
| Q | 81 | 01010001 | q | 113 | 01110001 |
| R | 82 | 01010010 | r | 114 | 01110010 |
| S | 83 | 01010011 | s | 115 | 01110011 |
| T | 84 | 01010100 | t | 116 | 01110100 |
| U | 85 | 01010101 | u | 117 | 01110101 |
| V | 86 | 01010110 | v | 118 | 01110110 |
| W | 87 | 01010111 | w | 119 | 01110111 |
| X | 88 | 01011000 | x | 120 | 01111000 |
| Y | 89 | 01011001 | y | 121 | 01111001 |
| Z | 90 | 01011010 | z | 122 | 01111010 |
Digits and common punctuation
| Character | Code | Binary |
|---|---|---|
0 | 48 | 00110000 |
1 | 49 | 00110001 |
| 2 | 50 | 00110010 |
| 3 | 51 | 00110011 |
| 4 | 52 | 00110100 |
| 5 | 53 | 00110101 |
| 6 | 54 | 00110110 |
| 7 | 55 | 00110111 |
| 8 | 56 | 00111000 |
| 9 | 57 | 00111001 |
| Space | 32 | 00100000 |
| ! | 33 | 00100001 |
| , | 44 | 00101100 |
| . | 46 | 00101110 |
| ? | 63 | 00111111 |
If you want the same letters as dots and dashes, the Morse code alphabet and Morse code numbers charts have them with audio.
Worked examples
Text to binary: "Hi"
H is 72, which is 64 + 8, so it becomes 01001000. Lowercase i is 105, which is 64 + 32 + 8 + 1, so it becomes 01101001. "Hi" in binary is 01001000 01101001, or 48 69 in hex.
Binary to text: 01001111 01001011
In the first byte the 64, 8, 4, 2 and 1 positions are on. They add up to 79, the letter O. The second byte has 64, 8, 2 and 1 on, which makes 75, the letter K. The message reads OK.
A character outside ASCII: é
é has the code point 233, which is too big for 7 bits, so ASCII cannot store it. UTF-8 writes it as two bytes, 11000011 10101001 (C3 A9 in hex). The 110 at the start of the first byte says a two-byte character begins here, and the 10 at the start of the second says this byte continues it. Strip those markers off and the bits that remain, 00011 and 101001, join up to 11101001, which is 233.
Common words in binary
| Text | Binary (8-bit, one byte per character) |
|---|---|
| Hello | 01001000 01100101 01101100 01101100 01101111 |
| hello | 01101000 01100101 01101100 01101100 01101111 |
| OK | 01001111 01001011 |
| SOS | 01010011 01001111 01010011 |
| I love you | 01001001 00100000 01101100 01101111 01110110 01100101 00100000 01111001 01101111 01110101 |
"Hello" and "hello" differ only in the first byte, because H and h are one bit apart. The spaces in "I love you" are characters too, each one 00100000. You can see the same words as dots and dashes on the Hello, SOS and I love you Morse pages.
Why binary decodes to strange symbols
Nearly every bad result comes from bits in the wrong groups. In 8-bit mode each byte needs exactly 8 digits. If one digit goes missing or gets doubled, every byte after it shifts and turns into nonsense. Paste with spaces between the bytes and a short or long group is easy to spot.
Check the mode as well. Binary written in 7-digit groups (1001000 1101001 for "Hi") reads wrongly in 8-bit mode, and the other way round. If the binary came from a program that saved text in a different encoding, such as UTF-16, its bytes will not line up with UTF-8 and the text will look scrambled. Before pasting, remove anything that is not a 0, a 1 or a space, such as commas or the 0b prefix that some programming languages put in front of binary numbers.
Morse code vs binary
Morse code and binary are both built from two states. A telegraph key or radio transmitter sends Morse by switching a signal on and off, so at the lowest level it is a stream of on and off, just like a stream of bits. Where the two codes differ is in how they mark the end of one character and the start of the next.
ASCII defines fixed 7-bit codes. In this tool’s 8-bit output, a decoder counts off eight bits, reads a letter and moves on. Morse letters have different lengths: E is a single dot and T a single dash, while Q takes four elements (--.-). Alfred Vail, who worked with Samuel Morse on the code, gave the shortest patterns to the letters that appear most often in English, which keeps typical messages short.
Morse code written as ones and zeros
If you write a Morse signal out in time units, with 1 for each unit of sound and 0 for each unit of silence, it becomes a string of bits. Standard Morse timing gives the rules:
| Morse element | Length | As bits |
|---|---|---|
| Dot | 1 unit on | 1 |
| Dash | 3 units on | 111 |
| Gap inside a letter | 1 unit off | 0 |
| Gap between letters | 3 units off | 000 |
| Gap between words | 7 units off | 0000000 |
So E is 1, T is 111 and A (.-) is 10111. SOS is sent as one unbroken signal, ...---..., with no letter gaps, which makes it 10101011101110111010101: 23 units. Sent as three separate letters with gaps it would take 27. In 8-bit ASCII the same three letters take 24 bits (01010011 01001111 01010011), and those bits only make sense because the receiver already knows to read them in groups of eight. The Morse string marks its own letter boundaries with silence.
To see the dots and dashes for any text, type it into the Morse code translator. To hear the timing, use the Morse audio generator, or watch it flash with Morse code light.
Why Morse needs gaps and binary text does not
Take the Morse sequence ..-. with no gaps in it. It could be F, but it could also be IN, ER, UE, ITE, EAE, EEN or EETE: eight valid readings using only the letters A to Z. The pauses tell the listener which one was meant, so a Morse decoder has to time the silences as carefully as the tones.
Computer codes get around this in two ways. ASCII makes every character the same length, so no separator is needed. UTF-8 marks the length with leading byte patterns and identifies continuation bytes. Many compression formats use prefix codes, where no symbol’s code is the beginning of another one, so a decoder knows where each symbol ends. Morse fails that test, since E (.) is the start of A (.-). Huffman coding, published in 1952, builds prefix codes that give common symbols the shortest codes, the same idea Vail used when he gave E a single dot. Prefix codes of this kind are still used inside ZIP files and JPEG images.
From telegraph codes to ASCII
The codes computers use for text grew out of telegraph codes. The famous Washington–Baltimore Morse telegraph demonstration took place in 1844, and its uneven letter lengths suited human operators better than machines. In 1874 Émile Baudot patented a 5-bit code in which every character had the same length. Donald Murray adapted it for punched paper tape in 1901, and a version of it became the international telegraph standard, ITA2, in the 1930s. ASCII was a 7-bit teleprinter code built partly on those earlier codes, and UTF-8, designed in 1992, extended it to cover all of Unicode while keeping ASCII's 128 codes unchanged.
| Comparison | Morse code | Binary text (ASCII / UTF-8) |
|---|---|---|
| Basic states | Signal on or off | 1 or 0 |
| Length of a character | 1 to 4 elements for letters, 5 for digits | 7-bit ASCII codes; stored here as 8-bit bytes, 1–4 bytes per UTF-8 code point |
| How characters are separated | Silences: 3 units between letters, 7 between words | Fixed 8-bit groups, plus lead bits in UTF-8 |
| Shorter codes for common letters | Yes, E is one dot | No, every ASCII letter uses one byte in this tool |
| Who reads it | People, by ear or by eye | Mostly machines |
| First used | 1844 | ASCII 1963, UTF-8 1992 |
More MorsePad tools
- Morse code translator: text to Morse code and back
- Morse code decoder: decode Morse from audio, your microphone or an image
- Morse audio generator: turn text into Morse audio and download a WAV
- Morse code light: flash Morse with your screen or phone torch
- Morse code alphabet: the full chart with audio
- Morse code numbers: digits 0 to 9 in Morse
- Learn Morse code: practise with the Koch method trainer
- Names and words in Morse code