Text to Binary/Hex/ASCII Converter
Convert text to binary, hexadecimal, and ASCII codes (or decode them back) with a live multi-format preview, per-character breakdown, separator and padding options, and full Unicode (UTF-8) support.
Your ad blocker is preventing us from showing ads
MiniWebtool is free because of ads. If this tool helped you, please support us by going Premium (ad‑free + faster tools), or allowlist MiniWebtool.com and reload.
- Allow ads for MiniWebtool.com, then reload
- Or upgrade to Premium (ad‑free)
About Text to Binary/Hex/ASCII Converter
The Text to Binary, Hex, ASCII Converter is a free online encoder and decoder that turns plain text into machine-friendly numeric codes — and back again. Whether you are debugging low-level data, learning how computers represent characters, building a programming assignment, or just curious about what your name looks like in 1s and 0s, this tool gives you binary, hexadecimal, decimal (ASCII), and octal output side-by-side, with a live preview that updates as you type and a per-character breakdown that shows the exact UTF-8 bytes behind every glyph.
What This Tool Does
This converter operates in two directions. In Encode mode, it takes any text you provide and translates each character into one or more bytes (using the universal UTF-8 standard), then displays those bytes in your chosen number system: binary (base 2), hexadecimal (base 16), ASCII decimal (base 10), or octal (base 8). In Decode mode, it reverses the process: paste a string of binary, hex, decimal, or octal codes and it reconstructs the original text.
How Text Becomes Numbers — A Quick Primer
Every character on a computer is ultimately stored as a number. The original ASCII standard, defined in 1963, mapped 128 characters (letters, digits, punctuation, control codes) to the numbers 0 through 127. Modern systems use Unicode, which assigns a unique codepoint to every character in every writing system on Earth, plus emoji, symbols, and more — over 149,000 codepoints in total. To store these efficiently, computers use an encoding called UTF-8: ASCII characters still take just one byte (so they look identical to old ASCII), but accented letters, CJK characters, and emoji use 2, 3, or 4 bytes each.
The letter
H has Unicode codepoint U+0048, which is the number 72. As a single UTF-8 byte that is 01001000 in binary, 48 in hex, 072 in decimal, or 110 in octal.The letter
i is U+0069 (105), which becomes 01101001, 69, 105, or 151.So the full encoding of "Hi" is:
01001000 01101001 (binary).
Common Number Systems Compared
| Character | Decimal | Binary (8-bit) | Hex | Octal |
|---|---|---|---|---|
| A | 65 | 01000001 | 41 | 101 |
| B | 66 | 01000010 | 42 | 102 |
| Z | 90 | 01011010 | 5A | 132 |
| a | 97 | 01100001 | 61 | 141 |
| z | 122 | 01111010 | 7A | 172 |
| 0 | 48 | 00110000 | 30 | 060 |
| 9 | 57 | 00111001 | 39 | 071 |
| (space) | 32 | 00100000 | 20 | 040 |
| ! | 33 | 00100001 | 21 | 041 |
| ? | 63 | 00111111 | 3F | 077 |
Step-by-Step: How to Use the Converter
- Choose direction: Use the toggle at the top to pick Encode (text to codes) or Decode (codes to text).
- Pick a format: Select Binary, Hexadecimal, ASCII (Decimal), or Octal as the target or source format.
- Type or paste your input: Enter your text or codes in the input box. As you type in encode mode, the live preview shows all four formats updating in real time.
- Adjust formatting options: Choose your preferred separator (space, comma, dash, newline, or none), enable zero-padding for consistent width, add language prefixes (0b, 0x, 0o), or switch hex to uppercase.
- Click Convert: The full encoded or decoded result appears below, along with an "All Formats at a Glance" panel and a per-character breakdown showing exactly how each character maps to its bytes.
- Copy or download: One click copies the output to your clipboard, or downloads it as a text file. You can also press "Use as Input" to round-trip the result back through the converter.
Smart Decoder — Forgiving Input Parsing
The decoder is designed to accept codes from many sources without requiring you to clean them up first:
- Multiple separators accepted: spaces, commas, dashes, semicolons, slashes, pipes, and new lines all work as token boundaries.
- Language prefixes auto-stripped: if your codes contain
0b,0x, or0oprefixes (common in C, Python, and other languages), they are removed automatically before parsing. - Fixed-width fallback: if you paste one long string with no separators, the decoder tries to split it into the natural width for that format — 8 characters for binary, 2 for hex, 3 for decimal or octal.
- Multi-byte UTF-8 reconstruction: when bytes form a valid UTF-8 sequence, they are joined to recreate accented letters, CJK characters, and emoji correctly.
Frequently Asked Questions
How does this tool convert text to binary?
Each character of your text is first encoded as one or more UTF-8 bytes, and each byte is then displayed as an 8-bit binary number. For example, the letter A is one byte (65) which becomes 01000001 in binary.
What is the difference between ASCII and Unicode here?
Plain ASCII covers only codepoints 0 to 127, which fit in a single byte. This tool uses UTF-8, which is a superset of ASCII: ASCII characters produce one byte, but accented letters, CJK characters, and emoji produce 2 to 4 bytes. The codes you see are the actual UTF-8 byte values, which is what files and network protocols actually transmit.
Can I decode codes that have no separator?
Yes. If your input is one long string with no spaces, the tool will try to split it into fixed-width groups: 8 characters for binary, 2 for hex, 3 for decimal or octal. Make sure padding is consistent so every byte uses the same width — for example, 01000001 not 1000001.
Why are some characters longer than 8 bits in binary?
Non-ASCII characters such as accented letters, Chinese characters, or emoji require more than one UTF-8 byte. Each byte is still 8 bits, but the character is represented by 2, 3, or 4 separate 8-bit groups. For example, the letter é is two bytes (11000011 10101001), and the rocket emoji 🚀 is four bytes.
What separators does the decoder accept?
The decoder accepts spaces, commas, dashes, semicolons, slashes, pipes, and new lines as separators between codes. It also strips 0b, 0x, and 0o prefixes automatically, so you can paste codes from most sources without cleaning them up first.
Is my text sent to a server?
Your text is processed on the server only when you click Convert. The live preview that updates as you type runs entirely in your browser using JavaScript, and is never transmitted.
Practical Use Cases
For Programming & Development
- Generate byte literals for embedded firmware or protocol payloads
- Inspect what bytes a string actually produces when serialized
- Build test fixtures for parsers, decoders, and serialization libraries
- Debug encoding-related bugs (mojibake, BOM issues, invalid UTF-8)
For Education & Learning
- Visualize how computers store letters, digits, and punctuation
- Demonstrate the relationship between binary, hex, decimal, and octal
- Teach UTF-8 multi-byte encoding with concrete examples
- Complete computer science homework involving number-system conversion
For Fun & Curiosity
- See your name written in pure 1s and 0s
- Encode secret messages for puzzles and escape rooms
- Generate "computer-speak" graphics or T-shirt designs
- Decode binary you found in a video game, movie, or geocache
Tips for Best Results
- Watch the live preview: as you type in encode mode, all four formats update simultaneously — useful for comparing how the same text looks in different bases.
- Keep zero-padding on for round-trips: consistent widths (8 for binary, 2 for hex, 3 for decimal/octal) ensure the decoder can split your codes correctly even without separators.
- Use prefixes when sharing with code: the
0b/0x/0oprefixes let you paste output directly into Python, JavaScript, C, or many other languages. - Use the "Use as Input" button: instantly round-trip your result back through the converter to verify accuracy.
- Try Unicode examples: the "Café 🚀" example demonstrates how multi-byte UTF-8 sequences work in practice.
Additional Resources
- ASCII - Wikipedia
- UTF-8 - Wikipedia
- Binary Number System - Wikipedia
- Hexadecimal - Wikipedia
- Octal - Wikipedia
Reference this content, page, or tool as:
"Text to Binary/Hex/ASCII Converter" at https://MiniWebtool.com/text-to-binary-hex-ascii-converter/ from MiniWebtool, https://MiniWebtool.com/
by miniwebtool team. Updated: Apr 27, 2026