Convert ASCII to Bytes
Convert text to UTF-8 byte values - decimal, hex, binary, octal, with JSON or C array output. Free, client-side, instant, offline.
- Runs in your browser
- Nothing uploaded
- Free, no sign-up
Encode text as a UTF-8 byte array - decimal, hex, binary, or octal, wrapped in a plain sequence, a JSON literal, or a C initializer. Unicode-safe.
How to Use Convert ASCII to Bytes
- Type or paste text into the input - ASCII, Latin characters, CJK, and emoji all work. The output recomputes within 150 ms of your last keystroke.
- Pick a byte format: decimal (default), hex (00-FF), binary (8-bit groups), or octal. Hex is the most common for file dumps, binary for protocol work, octal for POSIX file modes.
- Choose a wrapping: a plain space-separated list for quick copies, comma-separated for CSV, one-per-line for readable diffs, JSON array for pasting into a JS/TS literal, or C array for
uint8_t[]initializers. - Tick UPPERCASE hex if you prefer
FFoverff(default on). The toggle has no effect for decimal and octal output. - Tick Zero-pad to force fixed-width tokens -
01 08 0Fin hex or00000001 00001000in binary. Handy for aligned dumps. - Add a per-byte prefix like
0xfor C literals or0bfor assembly. Works with any format and combines with the wrapping. - Check the stats line: input characters, UTF-8 bytes, min/max byte value, and the count of multi-byte characters - helpful when you want to spot non-ASCII input quickly. Copy, Download, or press
Ctrl+Enterto run and copy in one shortcut.
Frequently asked questions
What is a byte in this context?
An 8-bit unsigned integer between 0 and 255. The tool runs your text through TextEncoder, which produces UTF-8 bytes, and then prints each one in your chosen format.
Why would I convert text to bytes?
For protocol analysis, firmware development, test fixtures, debugging encoding issues, generating C/JS array literals, or learning how computers store text at the byte level.
What output formats can I pick?
Decimal (0-255), hexadecimal (00-FF), binary (8-bit groups), and octal (000-377). Each has its own default pad width; the zero-pad toggle enforces fixed-width output.
Is my data secure?
Yes. Encoding runs entirely in your browser – nothing is uploaded, cached, or tracked. After the page loads you can disconnect the network and keep encoding indefinitely.
ASCII or UTF-8 bytes?
UTF-8. Plain ASCII (0-127) looks identical in both, but the tool uses TextEncoder so non-ASCII characters correctly expand to their multi-byte UTF-8 form.
Does it work offline?
Yes. HTML, CSS, and JavaScript are self-contained. Once the page has loaded, you can turn off Wi-Fi and the tool keeps working – useful on air-gapped machines.
Is it free?
Yes, 100% free with no cap on input length or number of encodes. No sign-up, no premium tier, no watermark.
What output shapes are useful for code?
The JSON-array and C-array wrappings are paste-ready literals. JSON ([72, 101, 108]) drops into any JS/TS/Python list. C-array ({ 0x48, 0x65, 0x6C }) fits directly into a uint8_t[] initializer – enable hex format, zero-pad, and the 0x prefix for the cleanest result.
Does it handle emoji?
Yes. Emoji encode to 4 UTF-8 bytes – 😀 becomes F0 9F 98 80 in hex. The “multi-byte chars” counter in the stats line tells you how many characters expanded beyond one byte.
How do I convert bytes back to text?
Use the sibling Bytes to ASCII converter. Round-trip is exact: the byte array out of this tool pastes cleanly into the other for decoding back to the original string.
Related Tools
Convert Bytes to ASCII →
Convert Bytes to ASCII: decode decimal, hex or binary byte values to text, UTF-8…
ASCII Case Converter →
Transform any text into Uppercase, Lowercase, Title Case, or Sentence Case safely formatting paragraphs…
Convert Arbitrary Base to ASCII →
Decode numeric strings in any base (2-36) to ASCII text - space, comma, or…
Convert ASCII to Arbitrary Base →
Convert ASCII to Arbitrary Base text to numeric strings in any base (2-36) -…
Convert ASCII to Base6 →
Encode text to Base64 - Unicode, URL-safe variant, optional 76-char line wrap. Free, client-side,…
ASCII to Decimal Converter →
Convert text to decimal ASCII codes or Unicode code points - strict, byte, UTF-8,…
ASCII to Hexadecimal Converter →
Convert ASCII to hexadecimal - code points or UTF-8 bytes, uppercase, 0x-prefix, JSON-array output.…
ASCII to HTML Entities Converter →
ASCII to HTML as entities - safe XSS escape, numeric decimal, or numeric hex.…
ASCII to Image Converter →
Render ASCII to Image art as a PNG - choose font size, family, colours,…
ASCII to Lowercase Converter →
Convert ASCII to lowercase - locale-aware for Turkish, Azerbaijani, and Lithuanian. Free, client-side, instant,…
ASCII to Morse Code Converter →
Encode ASCII to Morse Code code with Web Audio playback, adjustable WPM, and copy-ready…
ASCII to Octal Converter →
Convert ASCII to Octal (base 8) - code points or UTF-8 bytes, with separators,…