returns a string by decoding the data in the byte array ba, assuming UTF-8 encoding.
ByteArrayToString[ba,"encoding"]
interprets the data in the specified character encoding.


ByteArrayToString
returns a string by decoding the data in the byte array ba, assuming UTF-8 encoding.
ByteArrayToString[ba,"encoding"]
interprets the data in the specified character encoding.
Details

- In ByteArrayToString[ba,…], ba should be a ByteArray object.
- The value of "encoding" can be any member of $CharacterEncodings.
Examples
open all close allBasic Examples (2)
Scope (2)
Applications (1)
Extract the bytes of the page in a ByteArray object:
Properties & Relations (5)
All bytes can be represented in ISO8859-1:
The characters produced in this encoding have code points 0 to 255:
The length of the string generated is less than or equal to the length of the byte array:
An empty byte array produces an empty string:
An empty list is accepted as a synonym for an empty byte array:
ByteArrayToString[str] decodes UTF-8 bytes to a string representation:
FromCharacterCode[bytes] converts code points to a string:
ByteArrayToString is the inverse of StringToByteArray:
Related Guides
History
Text
Wolfram Research (2017), ByteArrayToString, Wolfram Language function, https://reference.wolfram.com/language/ref/ByteArrayToString.html.
CMS
Wolfram Language. 2017. "ByteArrayToString." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ByteArrayToString.html.
APA
Wolfram Language. (2017). ByteArrayToString. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ByteArrayToString.html
BibTeX
@misc{reference.wolfram_2025_bytearraytostring, author="Wolfram Research", title="{ByteArrayToString}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/ByteArrayToString.html}", note=[Accessed: 11-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_bytearraytostring, organization={Wolfram Research}, title={ByteArrayToString}, year={2017}, url={https://reference.wolfram.com/language/ref/ByteArrayToString.html}, note=[Accessed: 11-August-2025]}