Chuyển Đổi Văn Bản Sang Nhị Phân

Chuyển văn bản sang nhị phân (UTF-8) và nhị phân sang văn bản. 8 bit mỗi byte. Không tải lên máy chủ.

Xem hướng dẫn

Hướng Dẫn

What does this tool do

The Text to Binary Converter converts plain text to binary (0s and 1s) and back. Encode any UTF-8 text to 8-bit binary per byte, or decode a binary string to plain text. Supports optional spacing between bytes for readability. All processing runs in your browser—no server upload.

How to use it

  1. Choose mode — Switch between Text → Binary (encode) and Binary → Text (decode).
  2. Set separator (encode only) — Choose "Space between bytes" for readable output, or "No separator" for a continuous string.
  3. Enter input — For encode: type or paste text. For decode: paste a binary string (0s and 1s; spaces are ignored).
  4. View output — The result appears after clicking Convert. Invalid binary shows an error.
  5. Copy — Use the copy button to copy the output to the clipboard.

How it works

Encode: The input is encoded to UTF-8 via TextEncoder, then each byte is converted to an 8-bit binary string (zero-padded). Bytes can be joined with or without spaces. Decode: Spaces are stripped from the input, which must contain only 0 and 1. The string is split into 8-bit groups, converted to bytes, then decoded to UTF-8 via TextDecoder. Invalid binary (wrong characters, length not divisible by 8, invalid UTF-8) returns an error. Input is limited to 500KB to avoid heavy main-thread work.

All computation runs entirely in your browser. No data is sent to any server.

Use cases & examples

  • Learning — Understand how text is represented in binary.
  • Encoding — Encode messages or data for transmission.
  • Debugging — Inspect byte-level representation of strings.
  • Education — Teach ASCII/UTF-8 and binary representation.

Example

  • Encode Hello01001000 01100101 01101100 01101100 01101111 (with space)
  • Encode A01000001 (or 01000001 without separator)
  • Decode 01001000 01100101 01101100 01101100 01101111Hello

Limitations & known constraints

  • Input size — Maximum ~500KB (512,000 characters) to prevent browser slowdown.
  • Encoding — UTF-8 only; other encodings (e.g. Latin-1) not supported.
  • Binary format — 8 bits per byte; variable-length encodings (e.g. UTF-8 multi-byte sequences) are represented byte by byte.
  • Empty decode — Empty input in decode mode returns an error.

Tất cả tính toán và chuyển đổi chạy hoàn toàn trên trình duyệt. Không có dữ liệu được gửi đến máy chủ, dữ liệu của bạn không rời khỏi thiết bị.