How to use it
Pick Text to codes, type your text and choose a base: binary (0 and 1), hexadecimal (0–9 and A–F), decimal or octal. The result shows one code per byte, so “Hi” is 01001000 01101001 in binary, 48 69 in hex and 72 105 in decimal. Choose a separator for the codes. In the other direction, paste codes and get the text back; spaces, commas and prefixes like 0x are accepted, and a long unbroken run of 0s and 1s is read in groups of eight.
Letters, ASCII and Unicode
Computers store text as numbers. ASCII gives each of 128 characters a number from 0 to 127: capital A is 65, lower case a is 97 and the space is 32. Characters outside ASCII (é, €, 世, 🦆) are stored as UTF-8, which uses two to four bytes for them, so “é” becomes c3 a9. This tool always works with the UTF-8 bytes, which is what files and web pages actually contain. The table at the bottom lists the printable ASCII characters with their decimal, hex and binary codes.
Questions
Why does decoding fail? Every code must be a valid number in the chosen base from 0 to 255, and the bytes together must form valid UTF-8. Is this encryption? No, anyone can decode it. For number bases in general, see the Number Base Converter. Nothing you type leaves your browser.