# Superscript and subscript (sup, sub) in Confluence storage

URL: https://goingstellar.ro/reference/confluence-storage-format/superscript-subscript/

Superscript is sup and subscript is sub. ADF has a single subsup mark with a type attribute, and both elements round-trip unchanged. The legacy service mark macro renders a superscript but is dropped by an ADF save.

## Storage format

```xml
<sup>superscript</sup>
<sub>subscript</sub>
```

## In the editor

- Type SM, then apply the superscript formatting from the toolbar. Per the Atlassian documentation, as the replacement for the Service Mark macro.

## As ADF (Confluence Cloud)

The ADF that Confluence Cloud builds for:

```xml
<p><sup>superscript</sup></p>
```

```json
{
 "type": "doc",
 "content": [
  {
   "type": "paragraph",
   "content": [
    {
     "text": "superscript",
     "type": "text",
     "marks": [
      {
       "type": "subsup",
       "attrs": {
        "type": "sup"
       }
      }
     ]
    }
   ]
  }
 ],
 "version": 1
}
```

## Examples

Storage format sent:

```xml
<p><sup>superscript</sup></p>
```

Superscript as written in the storage format documentation, used for footnote marks and exponents.

Rendered view (HTML):

```html
<p><sup>superscript</sup></p>
```

Storage format after the round trip through ADF:

```xml
<p><sup>superscript</sup></p>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<p><sub>subscript</sub></p>
```

Subscript as written in the storage format documentation, used for chemical formulas.

Rendered view (HTML):

```html
<p><sub>subscript</sub></p>
```

Storage format after the round trip through ADF:

```xml
<p><sub>subscript</sub></p>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
ADF:{"content": [{"content": [{"marks": [{"type": "strong"}], "text": "b", "type": "text"}, {"text": " ", "type": "text"}, {"marks": [{"type": "underline"}], "text": "u", "type": "text"}, {"text": " ", "type": "text"}, {"marks": [{"type": "strike"}], "text": "s", "type": "text"}, {"text": " ", "type": "text"}, {"marks": [{"type": "code"}], "text": "c", "type": "text"}, {"text": " ", "type": "text"}, {"marks": [{"attrs": {"type": "sup"}, "type": "subsup"}], "text": "sup", "type": "text"}, {"text": " ", "type": "text"}, {"marks": [{"attrs": {"color": "#ff5630"}, "type": "textColor"}], "text": "red", "type": "text"}, {"text": " ", "type": "text"}, {"marks": [{"attrs": {"color": "#fedec8"}, "type": "backgroundColor"}], "text": "hl", "type": "text"}], "type": "paragraph"}], "type": "doc", "version": 1}
```

The sup element together with other marks in one ADF paragraph.

Rendered view (HTML):

```html
<p><style>[data-colorid=ygsqugo5p0]{color:#ff5630} html[data-color-mode=dark] [data-colorid=ygsqugo5p0]{color:#cf2600}</style><strong>b</strong> <u>u</u> <del>s</del> <code>c</code> <sup>sup</sup> <span data-colorid="ygsqugo5p0">red</span> <span style="background-color: rgb(254,222,200);">hl</span></p>
```

Storage format after the round trip through ADF:

```xml
<p><strong>b</strong> <u>u</u> <del>s</del> <code>c</code> <sup>sup</sup> <span style="color: rgb(255,86,48);">red</span> <span style="background-color: rgb(254,222,200);">hl</span></p>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<ac:structured-macro ac:name="sm"></ac:structured-macro>
```

The legacy service mark macro. It renders SM in a small superscript, and an ADF save replaces it with an empty paragraph.

Rendered view (HTML):

```html

<span class=" conf-macro output-inline" data-hasbody="false" data-macro-id="<id>" data-macro-name="sm" id="">
    <b> </b>
    <small>
        <sup id="sup-service-mark">SM</sup>
    </small>
</span>
```

Storage format after the round trip through ADF:

```xml
<p />
```

Sent to Confluence Cloud on 29 Nov 2026.

## What changes in conversion

- sup and sub map to the ADF subsup mark, with the attribute type set to sup or sub. Both return as the same element.
- The sm macro is not converted to a superscript. After an ADF save the storage holds an empty paragraph, so the service mark is lost.

## Pitfalls

- Typing SM and formatting it as superscript is the documented replacement for the macro, so existing macro pages should be rewritten that way before editing in the Cloud editor.
- The macro in the probe had no parameters or body, so nothing in the stored markup hints that an ADF save can erase it.

## Questions and answers

### Is there a separate ADF mark for sub and sup?

No. Both use the subsup mark, and the type attribute holds sup or sub.

## Related

- [<strong>, <em>, <b> and <i>](https://goingstellar.ro/reference/confluence-storage-format/bold-italic/)
- [Entities and special characters](https://goingstellar.ro/reference/confluence-storage-format/entities-special-characters/)
- [Macros removed from the Cloud editor](https://goingstellar.ro/reference/confluence-storage-format/legacy-macros/)
- [<code> inline code](https://goingstellar.ro/reference/confluence-storage-format/monospace/)
- [<small>, <big> and font size](https://goingstellar.ro/reference/confluence-storage-format/small-big-font-size/)

## Sources

- [Confluence storage format (Atlassian Documentation)](https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html)
- [Atlassian Document Format: document structure (Atlassian Developer)](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/)
- [Macros that are unavailable or have limited availability in the Cloud editor (Atlassian Support)](https://support.atlassian.com/confluence-cloud/docs/learn-which-macros-are-being-removed/)

