HOW TO

Add superscripts or subscripts to text in ArcGIS Pro

Last Published: August 19, 2025

Summary

In ArcGIS Pro, it may occasionally be necessary to add superscripts or subscripts to your text. For example, when labelling chemical compounds on an environmental map, you might need to include CO2 for carbon dioxide emissions. Similarly, in demographic maps, subscripts can be used to denote specific population subsets, such as P18-24 for the population aged 18 to 24. These superscripts or subscripts help ensure clarity and precision in maps and data.

Procedure

There are several ways to add superscripts or subscripts to text in ArcGIS Pro. These methods vary based on whether you want to modify attribute values or display superscripts/subscripts in labels without changing the underlying data. Below are the two primary scenarios, each with several methods:

Adding Superscripts or Subscripts to Attribute Values

Copy and Paste Unicode Characters

Manually copy superscript or subscript characters from the Official Unicode Consortium code chart and paste them into the attribute table, replacing the desired characters.

Use the Python String replace() Method

Replace characters directly within the attribute table using the Calculate Field tool:

  1. Right-click the target field and select Calculate Field.
  2. Make sure the Expression Type is set to Python.
  3. In the <Field Name> = field, use the replace() method to substitute characters. For example:
!ion!.replace("+","⁺").replace("-", "⁻")

This code replaces "+" and "-" with their superscript equivalents in the ion field, as shown in the next image.

superscript shown in ion field

Automate with a Python Function

For more complex replacements, write a Python function:

  1. Right-click the target field and select Calculate Field.
  2. Write a custom function in the Code Block field. For example:
def to_subscript(!ChemicalCompound!):
subscripts = str.maketrans("0123456789", "₀₁₂₃₄₅₆₇₈₉")
return text.translate(subscripts)
  1. Call the function in the Expression Field. For example:
to_subscript(!ChemicalCompound!)

This converts numbers in the ChemicalCompound field to subscripts, as shown in the next image.

subscripts shown in ChemicalCompound field

Displaying Superscripts or Subscripts in Labels Without Modifying Attribute Values

Use the Python String replace() Method with HTML Tags

ArcGIS Pro supports HTML tags for superscripts and subscripts in labels:

  1. Select the layer in the Contents Pane.
  2. In the Labeling tab, enable labels by clicking Label.
  3. Click Expression to open the Label Class pane and make sure the Language is set to Python.
  4. Use the replace() method with HTML tags (<SUP> for superscripts and <SUB> for subscripts). For example:
[ion].replace("+", "<SUP>+</SUP>").replace("-", "<SUP>-</SUP>")

This displays "+" and "-" as superscripts in labels for the ion field, as shown in the next image.

superscript shown in labels and table fields

superscripts in labels

Use a Python Function for Advanced Labelling

For more complex label transformations, write a Python function:

  1. Select the layer in the Contents Pane.
  2. In the Labeling tab, enable labels by clicking Label.
  3. Click Expression to open the Label Class pane and make sure the Language is set to Python.
  4. Enable Advanced mode.
  5. Define a transformation function and the FindLabel function. For example:
def to_subscript(text):
subscripts = str.maketrans("0123456789", "₀₁₂₃₄₅₆₇₈₉")
return text.translate(subscripts)

def FindLabel([ChemicalCompound]):
return to_subscript([ChemicalCompound])

This displays numbers in the ChemicalCompound field as subscripts in the label.

subscripts in labels only

no subscripts in underlying data

By following these methods, you can effectively add superscripts or subscripts to text in ArcGIS Pro, whether in attribute values or labels. Choose the approach that best suits the project requirements.

Article ID: 000034456

Software:
  • ArcGIS Pro

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options