Skip to content
UniKit

Binary bits to text

Pick a 0/1 bit-stream file (a serial log or classroom exercise), group it into bytes with a configurable bit width (1–8) and decode it: UTF-8 by default so multi-byte scripts work, or byte-by-byte Latin-1. The result comes with a hex preview and real stats, and illegal bytes, truncated groups or invalid UTF-8 are reported with their exact byte offset.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Pick a bit-stream file (text containing only 0/1 plus whitespace or separators, e.g. a serial log). It is read locally in your browser and never uploaded.

Pick a file first.

Result

These are the real numbers from this run — copy them straight out.

Pick a file and set the options; the result shows up here.

What this tool does

  • Turn a 0/1 bit-stream file from a serial log, microcontroller output or a classroom exercise back into text
  • Check what a 7-bit ASCII stream (telex, some sensor protocols) decodes to versus an 8-bit UTF-8 stream
  • Diagnose a suspicious stream: incomplete groups, illegal bytes and invalid UTF-8 are reported with their position, and the result includes a hex preview of the leading bytes

Example

Input

11100100 10111000 10101101

Output

中

Put those three groups into a .txt file (26 bytes including the two spaces) and pick it: the bytes are the UTF-8 encoding of "中" (E4 B8 AD). A width of 7 or 4 decodes the same bits very differently, so pick the width your source uses.

Frequently asked questions

What may the file contain besides 0 and 1?

Spaces, newlines, tabs, commas, semicolons, colons, underscores and hyphens are ignored as group separators, and you can add more ASCII separators in the options. Any other byte aborts the run and reports its byte offset instead of being silently skipped or guessed.

When should I use a 7-bit or 4-bit width?

The width decides how many bits form one byte. Standard UTF-8 / ASCII streams use 8; 7-bit is the stream width of early ASCII (some telex, barcode and sensor protocols); 4-bit is normally used for nibble checks. A wrong width does not raise an error but the text will be nonsense, so follow the source protocol.

Why does it say the bytes are not valid UTF-8?

The stream contains an illegal UTF-8 sequence, for example a lone 0xFF or 0x80, or a length byte that does not match the following bytes; the reported offset is the first offending byte. That means the data is not UTF-8 text — possibly corrupted, or encoded with something else. Switch to Latin-1 to at least see the raw bytes one by one.

What is the hex preview, and does it show the whole file?

It shows the leading bytes (32 by default, adjustable from 1 to 4096) as sixteen bytes per line: offset, hex and printable characters, so you can confirm you picked the right file. It is a preview only — it is not decoded and the file is never uploaded.

Keywords:binary to textbits to string

Related tools