Characters["string"]
gives a list of the characters in a string.
Characters
Characters["string"]
gives a list of the characters in a string.
Details
- Each character is given as a length one string.
- Characters handles both ordinary and special characters.
- Characters has attribute Listable.
Examples
open all close allBasic Examples (1)
Break a string into a list of characters:
Characters["A string."]Show in InputForm:
InputForm[%]StringJoin[%]Scope (2)
Characters handles special characters just like ordinary ones:
Characters["◆αβγ⟷𝒜ℬ𝒞↵🙂😠"]Characters threads itself element-wise over lists:
Characters[{"ABC", "DEF", "XYZ"}]Applications (4)
Break a string into overlapping trigrams:
Partition[Characters["this is a string"], 3, 1]StringJoin /@ %Sort the characters in a string:
Sort[Characters["this is a string"]]Length /@ Split[%]Rotate the characters in a string:
StringJoin[RotateLeft[Characters["ABCDEFG"]]]Make an array out of a list of strings:
data = NestList[StringReplace[#, {"A" -> "BA", "B" -> "A"}]&, "A", 5]Characters[data]Grid[PadLeft[%]]ArrayPlot[Characters[data], ColorRules -> {"A" -> Yellow, "B" -> Blue}, Mesh -> True]Properties & Relations (2)
Characters gives a list of strings of length 1:
Characters["A string."]InputForm[%]Characters splits characters composed of multiple codes into their individual codes:
Characters["हि"]Also, some emoji characters will break apart into their constituent parts:
Characters["👨🔧"]Possible Issues (3)
A string form of an expression must be created before it can be broken into characters:
Characters[x + y]Characters[ToString[x + y]]Characters operates on the explicit character form of strings:
Characters["red"]Characters normally treats special characters just like other characters:
Characters["αβγ"]Use ToString and FullForm to get the characters in the full names of special characters:
Characters[ToString[FullForm["αβγ"]]]See Also
String StringJoin StringLength ToCharacterCode StringExpression StringToStream CharacterRange Transliterate DiffGranularity
Function Repository: StringFunction
Tech Notes
Related Guides
History
Introduced in 1988 (1.0) | Updated in 1996 (3.0)
Text
Wolfram Research (1988), Characters, Wolfram Language function, https://reference.wolfram.com/language/ref/Characters.html (updated 1996).
CMS
Wolfram Language. 1988. "Characters." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/Characters.html.
APA
Wolfram Language. (1988). Characters. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Characters.html
BibTeX
@misc{reference.wolfram_2026_characters, author="Wolfram Research", title="{Characters}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/Characters.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_characters, organization={Wolfram Research}, title={Characters}, year={1996}, url={https://reference.wolfram.com/language/ref/Characters.html}, note=[Accessed: 13-June-2026]}