How DNA code works
Real DNA is written with four letters: A, C, G and T, one for each of the four chemical bases. A computer stores text as bytes, and each byte is eight bits, which is four pairs of bits. That makes a neat match: each pair of bits can be one DNA letter, with 00 as A, 01 as C, 10 as G and 11 as T. So every letter of text becomes four DNA letters, and the whole message becomes a long string that looks like a gene.
Take the letter A. A computer stores it as the number 65, which in binary is 01000001. Split that into pairs from the left: 01, 00, 00, 01. Those pairs are C, A, A and C, so A becomes CAAC. The same rule turns every letter, number and space into DNA letters, and the rule works backwards too, so the code can always be read back.
How to use the encoder
Type any short text in the box and press Encode to DNA, or just keep typing and the code updates live. The DNA code appears in large letters below, with a count of how many letters went in and how many DNA letters came out. A decode check shows the text again, so you can see the round trip works.
Press Copy code to put the DNA string on your clipboard, ready to paste into a message or a puzzle. Keep the text short, because the code is four times as long as the text: a ten-letter word becomes forty DNA letters. Use plain English letters, numbers and spaces, since the tool handles the first 128 characters.
Worked example
Take the word Hi. The letter H is the number 72, which in binary is 01001000. Split into pairs: 01, 00, 10, 00, which are C, A, G and A, so H becomes CAGA. The letter i is the number 105, which in binary is 01101001. Split into pairs: 01, 10, 10, 01, which are C, G, G and C, so i becomes CGGC. Put them together and Hi becomes CAGACGGC, eight DNA letters for two text letters.
Take the letter A on its own. A is 65, binary 01000001, pairs 01, 00, 00, 01, which is C, A, A, C. The digit 0 is 48, binary 00110000, pairs 00, 11, 00, 00, which is A, T, A, A, so 0 becomes ATAA. Decoding CAAC gives A back, which is how you check any code you receive.
Who uses this encoder
Science teachers use it most, to show students how information can be stored in DNA, the same way a computer stores it in bits. It turns an abstract idea into something students can play with: type your name, see it as DNA, and decode it back. Puzzle fans use it to hide messages in a string that looks like a gene, and friends use it to send each other secret notes that look like science.
It also helps anyone curious about real DNA storage, where scientists really do store files as DNA letters in a lab. This tool is a small, simple version of that idea, with the same 2-bit rule, so it shows how the real thing works without any lab at all.
Honest limitations
This tool is a fun cipher, not real DNA and not a secure code. Anyone who knows the rule can decode your message in seconds, so never use it for anything private. It only handles plain English letters, numbers and spaces, the first 128 characters, so accented letters and emoji do not work.
The code is also four times as long as the text, so long messages become very long strings. Real DNA storage in a lab uses extra steps to fix errors and to pack the data tighter, which this simple tool does not do. Treat it as a teaching toy and a puzzle, not as a way to store or protect real information.
Frequently asked questions
Why does each letter become four DNA letters? Because one byte is eight bits, which is four pairs of bits, and each pair is one DNA letter. So a letter always becomes exactly four DNA letters.
Can I decode a DNA string back to text? Yes. The tool shows a decode check under every code, and any string made with the same rule can be read back, four letters at a time.
Is this how scientists store data in DNA? The idea is the same, but the real method adds error checks and packs the data tighter. This tool uses the plain 2-bit rule, which is the simplest version.
Why do accented letters not work? The tool handles only the first 128 characters, the plain English set. Accented letters use higher numbers, which would need more than one byte each.
También disponible en español: Codificador De Texto En Código ADN – Convierte Texto En A C G Y T
