What an encoder does
Computers store text as bytes. An encoding writes those bytes in another alphabet so they can pass through a system that only accepts certain characters. Base64 uses 64 safe characters, hex uses 0 to 9 and a to f, and binary uses only 0 and 1. URL and HTML encoding work differently: they leave most text alone and replace only the characters that would break a URL or a web page.
The encoder on this page first turns your text into UTF-8 bytes and then writes those bytes in each format. Decoding runs the same steps backwards.
One input in every format
Here is the word Hi! in each encoding. The bytes are the same every time, only written differently.
| Format | Hi! becomes | Length |
|---|---|---|
| Binary | 01001000 01101001 00100001 | 24 digits |
| Hex | 48 69 21 | 6 digits |
| Base64 | SGkh | 4 characters |
| URL | Hi%21 | 5 characters |
Binary, decimal and hex numbers
The number converters work on numbers, where the encoders above work on text. A binary number such as 10011100 is the value 156, and in hex it is 9C. Hex is the short way to write bits, with one hex digit for every four bits. Each converter shows its working: the place values for binary to decimal, the divisions by 2 for decimal to binary, and the groups of four bits for binary to hex and hex to binary.
Encoding does not hide anything
Encoded text can look scrambled, but there is no key involved. Anyone who recognizes the format can decode it, and tools like this one do it instantly. If you need to keep a message secret, you need encryption. If you want to know whether a message is encoded or enciphered, the cipher decoder tries both kinds at once.
Frequently asked questions
Is Base64 a kind of encryption?
No. Base64 has no key, so anyone can decode it in one step. It exists to carry binary data through systems that only accept text, such as email. Use real encryption if the content needs to stay private.
Why does Base64 often end with = signs?
Base64 turns every 3 bytes into 4 characters. When the input length is not a multiple of 3, one or two = signs pad the output so its length is a multiple of 4.
What is the difference between hex and binary?
Both write the same bytes. Binary uses 8 digits (0 or 1) per byte, and hex uses 2 digits from 0 to 9 and a to f. Hex is four times shorter, which is why programmers prefer it.
Why does URL encoding turn a space into %20 or +?
Both mean a space. %20 is the general percent encoding used in any part of a URL. The + sign is used for spaces in form data and query strings sent by HTML forms.