We deliver solutions for the AI eraâcombining symbolic computation, data-driven insights and deep technology expertise.
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 Examplesopen allclose all Basic Examples (2)Create a string from a ByteArray, assuming it contains UTF-8 data:
Create a string from a ByteArray, interpreting the data as ISO 8859-7 Latin/Greek:
Scope (2)Convert ASCII bytes of English capital letters to a string:
Compare different character encodings:
Applications (1)Extract the bytes of the page in a ByteArray object:
Convert the UTF-8 encoded data to a string:
Display the first five lines of the raw page:
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:
Possible Issues (1)Not all byte sequences are valid UTF-8 codes:
Invalid bytes—in this case 162—are interpreted as literal code points:
Converting the string back to a byte array produces a different but valid UTF-8 byte sequence:
Wolfram Research (2017), ByteArrayToString, Wolfram Language function, https://reference.wolfram.com/language/ref/ByteArrayToString.html. TextWolfram Research (2017), ByteArrayToString, Wolfram Language function, https://reference.wolfram.com/language/ref/ByteArrayToString.html.
CMSWolfram Language. 2017. "ByteArrayToString." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ByteArrayToString.html.
APAWolfram 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: 12-July-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: 12-July-2025 ]}
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4