Binary and text converter
Encode UTF-8 text or file bytes as eight-bit groups or a MATLAB numeric row vector assignment; decode bit text to exact bytes.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Convert UTF-8 text or any file into eight-bit byte groups or a MATLAB assignment that creates one numeric 0/1 row vector. Decode bit text back to exact bytes.
How to use this tool
- Choose Encode or Decode. For encoding, select byte groups or a MATLAB numeric row vector assignment.
- For encoding, enter UTF-8 text or select any file. For decoding, paste 0/1 bit text or choose a UTF-8 .txt or .bits file.
- Convert, preview, then copy or download the full bit text or MATLAB .m file; decoding preserves exact bytes.
Supported inputs and limits
Paste up to 1 MiB of text or select one file up to 2 MiB. Bit-text files must be UTF-8 text.
Use only 0 and 1, with a multiple of eight bits. ASCII whitespace is ignored. Prefixes, offsets and partial bytes are not parsed.
MATLAB output represents UTF-8 bytes, so non-ASCII text may differ from MATLAB character-code bits. Conversion runs in your browser; binary encoding is not encryption.
Worked example
Example input
A
Example options
{"mode":"encode"}Example output
01000001
When something does not work
For invalid bit text, check that each byte has eight 0/1 digits and remove prefixes or offsets. For binary output, download decoded.bin.
Frequently asked questions
Can I encode a binary file?
Yes. Choose File and Encode; the original file bytes become eight-bit groups without text decoding.
What if decoded bytes are not text?
Download decoded.bin to retain the exact bytes. A text preview and decoded.txt appear only for readable UTF-8.
Can I pass the bits to a MATLAB function?
Choose MATLAB numeric row vector while encoding, then run the assignment. It creates bits as a row vector of numeric 0 and 1 values. The source text is encoded as UTF-8 bytes, which can differ from MATLAB character codes for non-ASCII text.
Is my input sent to a server?
No. Conversion happens in your browser. Save your output before closing the tab.
Documentation & further reading
Related tools
Base64 encoder and decoder
Encode text or file bytes as Base64, or decode Base64 to UTF-8 text or a binary file.
URL encoder and decoder
Percent-encode or decode a URL component or whole URL, with optional plus-to-space decoding.
HTML entity encoder and decoder
Encode special HTML characters, or decode named and numeric references as plain text.
Unicode escape converter
Convert text to Unicode escapes or decode supported JavaScript-style escapes into readable text.