Wolfram Archive
Wolfram Programming Lab is a legacy product.
All the same functionality and features, including access to Programming Lab Explorations, are available with Wolfram|One.
Start programming now. »
Try it now »
(no sign-in required)

# Character Space

Find out what Unicode characters there are and how theyre encoded.

Run the code to get the character codes of the characters in a text string. Try different strings:

Characters are represented on computers by numeric character codes. There are various ways to assign codes to characters; the Wolfram Language uses the Unicode standard.

In Unicode, the character A is represented by 65:

ToCharacterCode["A"]

Get the character codes of a longer text string:

ToCharacterCode["ABCabc"]

ToCharacterCode["ABCabc"]

Turn character codes into characters. Try different character codes:

Turn character codes into characters with FromCharacterCode.

In Unicode, 97 represents the lowercase character a:

FromCharacterCode[97]

Get the character string that corresponds to a list of character codes:

FromCharacterCode[{72, 101, 108, 108, 111, 33}]

FromCharacterCode[{72, 101, 108, 108, 111, 33}]

Get a range of characters. Try different ranges:

Character sets like alphabets or digits occupy ranges of adjacent character codes in Unicode.

The characters from 97 to 122 are the Latin alphabet:

FromCharacterCode[Range[97, 122]]

The characters from 48 to 57 are the digits:

FromCharacterCode[Range[48, 57]]

The Greek alphabet occupies character codes 945 to 969:

FromCharacterCode[Range[945, 969]]

FromCharacterCode[Range[1, 1000]]

Display a character and its code. Try character codes other than 8364:

Note: replace both instances of 8364 to change the character code.

The euro symbol is Unicode 8364:

FromCharacterCode[8364]

Use Style to display the character in a 100-point font (a point is a printers measure equal to 1/72 inch):

Style[FromCharacterCode[8364], 100]

Label the character with its character code:

Labeled[Style[FromCharacterCode[8364], 100], 8364]

Labeled[Style[FromCharacterCode[8364], 100], 8364]

Make it interactive. Drag the slider to explore Unicode characters:

Hint: press (or ) for fine control while dragging the slider; press + (or +) for even finer control.

This displays a large euro symbol and its character code:

Labeled[Style[FromCharacterCode[8364], 100], 8364]

Make an interactive interface that lets you choose the character that is displayed using Manipulate.

Wrap the Labeled expression with Manipulate, replace the fixed character code 8364 with the variable n, and specify that n ranges from 0 to 65535 in steps of 1. Drag the slider to see different characters and their codes:

Manipulate[ Labeled[Style[FromCharacterCode[n], 100], n], {n, 0, 65535, 1} ]

Manipulate[ Labeled[Style[FromCharacterCode[n], 100], n], {n, 0, 65535, 1} ]

Explore ranges of characters:

Replace n with a range, add a control for dn, and let the range go from n to n+dn. The upper limit 65535 of n must be reduced to 65435 to leave room for a dn value of 100:

Manipulate[ Labeled[Style[FromCharacterCode[Range[n, n + dn]], 40], {n, n + dn}], {n, 0, 65435, 1}, {dn, 0, 100, 1} ]

Manipulate[ Labeled[Style[FromCharacterCode[Range[n, n + dn]], 40], {n, n + dn}], {n, 0, 65435, 1}, {dn, 0, 100, 1} ]

Share ItMake an interactive website for exploring the Unicode character space:

Deploy the Manipulate to the Wolfram Cloud where anyone with a browser can use it:

CloudDeploy[ Manipulate[ Labeled[Style[FromCharacterCode[Range[n, n + dn]], 40], {n, n + dn}], {n, 0, 65435, 1}, {dn, 0, 100, 1} ], Permissions -> "Public" ]

Click on the link in the output to visit the site.