Developer Tools
Text to Binary, Hex, Octal & Decimal
Convert text to binary, hexadecimal, octal or decimal byte codes (UTF-8), and convert those codes back to text.
How to use
- 1Choose the number format and direction.
- 2Paste text, or space-separated codes to decode.
Frequently asked questions
How is text turned into binary?
Each character is encoded as UTF-8 bytes, and each byte is written as eight binary digits. 'A' is 01000001.
Why do some characters produce several bytes?
UTF-8 uses one byte for basic English and 2–4 bytes for accented letters, other scripts and emoji.
What input does decoding accept?
Codes separated by spaces, commas or new lines. Hex can include a 0x prefix, and binary can be written without spaces in groups of eight.
Worked example: Text to Binary, Hex, Octal & Decimal
The text "Hi" converts to 01001000 01101001 in binary — two 8-bit groups, one per UTF-8 byte. The same "Hi" in hex is just 48 69, and in decimal it's 72 105 — three different-looking representations of the identical two bytes, since 72 in decimal, 0x48 in hex, and 01001000 in binary are all the same number. Switch the input to é (one accented character) in hex mode and the output is C3 A9 — two bytes, not one, because é needs 2 bytes to represent in UTF-8 even though it displays as a single character.
Why decoding is more forgiving than you'd expect
The decoder accepts several input shapes for the same data: space-separated groups (72 105), comma-separated (72, 105), hex with or without a 0x prefix (0x48 0x69 or 4869), and even an unbroken binary string with no separators at all, which it auto-splits into 8-bit chunks as long as the length divides evenly by 8. That flexibility matters because codes get pasted from all kinds of sources — a debugger's memory dump, a spec document, a textbook exercise — each with its own formatting convention, and the tool normalizes all of them rather than forcing one exact format.
Why a seemingly valid-looking code can still fail
Decoding "01002" fails specifically because binary digits can only be 0 or 1 — the stray 2 isn't a valid binary digit at all, regardless of grouping. More subtly, even a sequence of entirely valid bytes can fail at the final step if those particular byte values don't form valid UTF-8 — multi-byte UTF-8 sequences have strict structural rules about which byte values can follow which, so a technically well-formed list of numbers can still not decode to readable text if it doesn't correspond to a real UTF-8 byte sequence.
Why every format pads to a fixed width except decimal
Binary digits are padded to 8 characters, hex to 2, and octal to 3 — but decimal is left unpadded entirely, printed as plain numbers like 72 105. The padded widths exist because binary, hex and octal are positional digit systems where leading zeros are visually necessary to show you're looking at a fixed-size byte (01000001, not 1000001, for the letter A) — without that padding, byte boundaries in a long run of digits would be ambiguous. Decimal bytes need no such padding because each one is naturally separated by a space already, and a single decimal number never represents more than one byte here (255 is the maximum any byte can hold), so there's no boundary-ambiguity problem to solve.
The same letter looks completely different across formats — on purpose
The capital letter A (byte value 65) renders as 01000001 in binary, 41 in hex, 101 in octal, and just 65 in decimal — four representations of the identical underlying number, since 65 decimal, 0x41 hex, 0o101 octal and 0b01000001 are all mathematically the same value written in different bases. None of these is more 'correct' than another; the choice of which format to use depends entirely on context — hex is the convention in debuggers and memory dumps, binary is what's used to teach how bytes actually work at the bit level, and octal mostly survives today in Unix file permission notation (chmod 755) rather than general text encoding.
Related tools
- Number Base Converter (Binary, Hex, Octal)
Convert numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36 — including very large integers.
- ASCII Table
Full ASCII table with decimal, hex, octal and binary codes for all 128 characters, control code names and HTML entities.
- Base64 Encode / Decode
Encode text to Base64 or decode Base64 back to text, with full UTF-8 support and a URL-safe option.
- HTML Checker (Tags, Accessibility, SEO Basics)
Check HTML for unclosed or mismatched tags, duplicate IDs, images without alt text, missing lang/title/viewport and other common mistakes.
- Image to ASCII Art
Turn any picture into ASCII text art — choose the width, character set and inversion — then copy it or download as a text file.
- Morse Code Translator
Translate text to Morse code and Morse back to text using the international standard, with letters, numbers and punctuation.