Text to Binary, Morse & More
runs in your browserConvert text to binary, hex, octal, decimal, Unicode escapes, Morse code or the NATO alphabet, apply ROT13 or a Caesar shift, and reverse it back.
Eight bits per UTF-8 byte.
Text
Binary
about this tool
Bytes, not characters
Binary, hex, octal and decimal all work on UTF-8 bytes rather than code points. That is what every other tool means by "the binary of this text", and it is what makes the round trip exact.
The difference shows up the moment the text is not plain English. The letter
é is one character but two bytes, so it produces two units, and an emoji
produces four. A tool that encodes code points instead would give a different
answer and would not decode anywhere else.
Decoding is forgiving about how the input is written: extra spaces, commas
between units and a 0x prefix are all accepted. It is strict about the
result, though. Bytes that are not valid UTF-8 are reported rather than
returned as replacement characters.
Reversing without breaking things
Reversing a string by character index tears apart anything built from more than one code unit. An emoji comes out as two pieces of a broken pair, and a family emoji, which is several emoji joined together, scatters completely.
This reverses by grapheme, meaning by character as a reader sees it, so emoji and accented letters survive intact.
Morse and the NATO alphabet
Morse uses the ITU table, with a space between letters and a slash between words. Case does not exist in Morse, so decoding returns lower case.
The NATO alphabet is for reading something aloud over a bad line: a serial number, a booking reference, a postcode. Each letter and digit has a word chosen to be hard to confuse with any other.
ROT13 and Caesar
Neither is encryption. ROT13 rotates letters by thirteen, which is exactly half the alphabet, so applying it twice returns the original text. It exists to hide a spoiler or a punchline from a casual glance, nothing more. A Caesar shift is the same idea with a number you choose, and is broken by trying all twenty-five.