String to Byte Converter
Convert a string to its UTF-8 byte values in decimal (0–255).
Encoders & Decoders Runs in your browser
How do you convert a string to bytes?
Characters and bytes are not the same thing, and this tool shows the gap. It UTF-8 encodes whatever you type and lists each byte as a decimal from 0 to 255: “Hi” yields 72 105, while “é” yields 195 169 because it occupies two bytes. Handy when you need an array literal for embedded code or want to see why a string’s byte length exceeds its character count.
How to use the String to Byte
- 1 Type a string, or paste one from your source code.
- 2 Read off the space-separated decimal values, one per UTF-8 byte.
- 3 Multibyte characters show as runs of two to four numbers.
- 4 Copy the sequence into your array literal.
What you can use it for
- Building a byte array literal for code.
- Inspecting how a string is stored in memory.
- Preparing byte test data for low-level functions.
- Teaching the difference between characters and bytes.
Frequently asked questions
Are these the same as ASCII codes?
Only for characters below 128, where UTF-8 and ASCII agree. Beyond that they diverge: “ñ” is one character but two bytes, 195 177, neither of which is an ASCII code.
What is the range of each value?
0 to 255, since each number is one octet. A value from 194 to 244 opens a multibyte sequence; 128 to 191 marks a continuation byte.
How do I rebuild the string?
Feed the numbers to the Byte to String converter, which reassembles UTF-8 sequences into characters. Any decoder that accepts a byte array does the same job.
Related tools
More Encoders & Decoders
More tools like this:
All Encoders & Decoders