Works on this device
Number Base & Text Converter
Turn text into binary, hexadecimal, decimal or octal codes, or turn such codes back into text. The result shows as you type. The text is converted in your browser and is not sent to a server.
Your text or codes
Check these values
Your text is converted in this browser. It is not sent to a server.
The result will show here
Type or paste something, or choose Try an example.
Result
How it was worked out
How to use this converter
- Choose the direction in the menu, such as Text to binary or Binary to text.
- Type or paste your text or your codes. The result shows as you type.
- Choose what one number stands for. One byte of the text is the usual choice. One character gives the Unicode code point of each character.
- For bytes, choose the text encoding. UTF-8 is the usual choice.
- Choose what stands between the values: a space, a comma, a new line or nothing. Under More options you can group bytes and, for hexadecimal, add a mark such as
0x. - Choose Copy output or Download output to keep the result. Download CSV also saves the table of characters.
How text becomes numbers
A computer stores text as numbers. Each character has a number called its Unicode code point. The letter A is 65 and the emoji 😀 is 128512.
To store text, the code points are written as bytes. A byte is a number from 0 to 255, which is 8 binary digits. The text encoding says how. In UTF-8, the 128 characters of ASCII take 1 byte each, and other characters take 2, 3 or 4 bytes.
The same byte can be written in four ways. The byte 72 in decimal is 01001000 in binary, 48 in hexadecimal and 110 in octal.
- Binary uses the digits 0 and 1. One byte is 8 digits.
- Hexadecimal uses 0 to 9 and A to F. One byte is 2 digits.
- Decimal uses 0 to 9. One byte is a number from 0 to 255. For plain English text these are the ASCII codes.
- Octal uses 0 to 7. One byte is up to 3 digits, from 000 to 377.
Worked example
The text Hi has two characters. H is 72 and i is 105. In binary that is 01001000 01101001, in hexadecimal 48 69, in decimal 72 105 and in octal 110 151.
The letter é has the code point 233 (U+00E9). In UTF-8 it is the two bytes C3 A9, which are 11000011 10101001 in binary. In ISO-8859-1 it is the single byte E9.
The emoji 😀 has the code point 128512 (U+1F600). In UTF-8 it is the four bytes F0 9F 98 80.
Reading codes back to text
- Put a space, a comma or a new line between the values. Colons, semicolons and hyphens also work.
- Binary, hexadecimal and octal bytes can also be written in one run with nothing between them, when every byte has its full 8, 2 or 3 digits.
- The marks
0b(binary),0o(octal), and0x,\x,%andU+(hexadecimal) before a value are accepted. - The page is strict. A wrong digit, a value larger than one byte and bytes that are not valid text are reported with their place. Nothing is changed without telling you. Under More options you can ask for wrong bytes to be shown as �.
Limits you should know
- This page converts text and its codes. To convert a number from one base to another, such as decimal 45 to binary 101101, use the Numeral System Converter.
- The text can have up to 100,000 characters. The table of characters lists the first 200.
- A text box holds a line break as one character, LF (10). Windows files use two, CR and LF (13 and 10).
- The text encodings are UTF-8, UTF-16 (both byte orders), ISO-8859-1, Windows-1252 and ASCII. Windows-1252 has five byte values with no character (81, 8D, 8F, 90 and 9D); they are reported as errors.
- It does not open files, and it does not make pictures or banners out of characters (ASCII art).