Binary Text Converter

Turn text into binary, hexadecimal, decimal or octal bytes, and read those bytes back as text.

Runs on your deviceTextWorkingNo account needed

What this tool does

Binary Text Converter works one byte at a time. Encoding runs your text through a UTF-8 encoder and writes each resulting byte in the base you picked, padded to a fixed width: eight digits for binary, two for hexadecimal, three for octal. Decimal is the exception and is written without padding, because decimal bytes have no single natural width. Decoding reverses that exactly — each value is parsed back to a byte, and the collected bytes are read as UTF-8.

Direction is guessed by default, and the guess is deliberately timid — it is much narrower than the decoder behind it. Values parted by spaces or new lines are read as already encoded; an unseparated run only counts when it divides evenly into bytes, so 01001000 decodes to H while 0100 is encoded as four characters of text. A run of hexadecimal letters with no separator and no 0x is read as text as well, so typing "cafe" or "decade" gives you their bits rather than an unwanted decode, and decimal and octal are never detected without separators, since bare digits are far more often just a number someone wants encoded. Two forms the decoder handles happily are invisible to the guess: a comma anywhere stops binary, hexadecimal and octal from being recognised, and hexadecimal is only recognised when at most one lowercase 0x sits at the very front. Set Direction to Text → numbers or Numbers → text and the guess is bypassed entirely.

Two constraints decide what this converter is for. It is byte-oriented: every value has to land between 0 and 255, and anything larger is refused by name rather than silently wrapped, so it is the wrong tool for converting a large number between bases — Number Base Converter does that. And the character encoding is always UTF-8, with no Latin-1 or UTF-16 alternative, which means an accented letter costs two bytes and an emoji four. Bytes that do not form valid UTF-8 come back as the replacement character rather than as an error, so a decode that produces rows of question-mark diamonds is telling you the input was not UTF-8 text in the first place.

The conversion happens in this browser tab, so what you paste is not uploaded anywhere and the page keeps working with the network off. That matters because the strings people convert are often keys, tokens or fragments of a protocol dump. The trade-off is that it reads typed or pasted text only — there is no file input, so it will not produce a hex dump of a binary file.

How to use it

  1. Paste text, or paste values. Either direction uses the same box. Press Load sample for a short word to see the shape of the output before committing your own input.
  2. Choose the number format. Binary for base 2, hexadecimal for base 16, decimal for base 10, octal for base 8. The same choice governs both encoding and decoding.
  3. Set the direction if the guess is wrong. Detect automatically is the default. Text → numbers and Numbers → text override it when your input sits on the edge of the detection rules.
  4. Pick a separator, and hex styling. A space, nothing, a new line, or a comma and a space, applied when encoding — the control disappears once you choose Numbers → text. Hexadecimal adds uppercase digits and a 0x prefix on each value.
  5. Read the result back if it matters. Paste the output into the box again with the same format, and set Direction to Numbers → text — comma-separated values and 0x prefixes decode correctly but are not recognised automatically.

Processing & privacy

Runs on your device. Your file is processed directly in this browser.

Common use cases

Reading values out of a protocol or memory dump

Hex bytes copied from a debugger or a packet capture become readable text once Direction is set to Numbers → text; the decoder removes 0x prefixes itself, so a dump full of them still parses.

Answering a puzzle or a classroom exercise

Converting a name to bits and back is the standard exercise, and the eight-digit binary groups line up with how the byte is usually taught.

Checking what a string really costs in bytes

The summary reports characters in and bytes out, so a short line of emoji visibly costs more than it looks. Read the character figure as UTF-16 units, where one emoji already counts as two.

Building a byte array for source code

Hexadecimal with the 0x prefix and the comma separator produces 0x48, 0x69 — the body of an array literal in C, Java or Rust, ready to paste.

Questions

Do the bytes I paste go anywhere?
No. The encoding and decoding both run in this browser tab, nothing is transmitted or stored, and the page still converts with the network disconnected.
Why did it encode my input when I wanted it decoded?
Usually a comma or a repeated 0x: neither is recognised by the automatic guess, although the decoder accepts both. The guess also reads letters-only hexadecimal without separators as ordinary words, and wants decimal and octal values separated. Set Direction to Numbers → text to force a decode.
What happens to accented characters and emoji?
They are encoded as UTF-8, so they occupy more than one byte each: é is two bytes and most emoji are four. The round trip is lossless — decoding those bytes with the same format returns the original characters.
Can it convert a number larger than 255?
No. Each value represents one byte, and anything outside 0–255 is reported as out of range instead of being truncated. Number Base Converter is the tool for converting an arbitrary number between bases.
Why can I not encode decimal with no separator?
Because the result could not be read back. Binary, hexadecimal and octal have fixed widths, so unseparated digits can be cut into bytes; decimal values vary in length, so the job is refused rather than producing output that decodes to nonsense.
What happens if a value is malformed?
It is named in the error. A stray digit outside the base is quoted back to you, and unseparated binary that does not divide into 8-digit bytes is reported as such rather than being padded on a guess.

Related tools