# Confluence storage format vs ADF: what converts

URL: https://goingstellar.ro/reference/confluence-storage-format/storage-vs-adf/

Storage format is the XHTML-based format that Confluence stores for pages. ADF is the JSON document that the Cloud editor edits. Confluence builds ADF from storage when asked, and the editor saves ADF back, so a page that is opened and saved in the Cloud editor is rewritten by that conversion.

## Storage format

```xml
<p>Text</p>
<ac:structured-macro ac:name="NAME"><ac:parameter ac:name="PARAM">value</ac:parameter></ac:structured-macro>
<ac:layout><ac:layout-section ac:type="two_equal"><ac:layout-cell><p>a</p></ac:layout-cell><ac:layout-cell><p>b</p></ac:layout-cell></ac:layout-section></ac:layout>
```

## As ADF (Confluence Cloud)

The ADF that Confluence Cloud builds for:

```xml
<ac:structured-macro ac:name="section"><ac:rich-text-body><ac:structured-macro ac:name="column"><ac:parameter ac:name="width">50%</ac:parameter><ac:rich-text-body><p>col 1</p></ac:rich-text-body></ac:structured-macro><ac:structured-macro ac:name="column"><ac:rich-text-body><p>col 2</p></ac:rich-text-body></ac:structured-macro></ac:rich-text-body></ac:structured-macro>
```

```json
{
 "type": "doc",
 "content": [
  {
   "type": "layoutSection",
   "content": [
    {
     "type": "layoutColumn",
     "attrs": {
      "width": 50.0
     },
     "content": [
      {
       "type": "paragraph",
       "content": [
        {
         "text": "col 1",
         "type": "text"
        }
       ]
      }
     ]
    },
    {
     "type": "layoutColumn",
     "attrs": {
      "width": 50.0
     },
     "content": [
      {
       "type": "paragraph",
       "content": [
        {
         "text": "col 2",
         "type": "text"
        }
       ]
      }
     ]
    }
   ]
  }
 ],
 "version": 1
}
```

## Examples

Storage format sent:

```xml
<p><span style="text-decoration: line-through;">strikethrough</span></p>
```

The strikethrough example from the storage format documentation. The ADF round trip returns the text with no line-through styling.

Rendered view (HTML):

```html
<p><span style="text-decoration: line-through;">strikethrough</span></p>
```

Storage format after the round trip through ADF:

```xml
<p>strikethrough</p>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<div><p>in a div</p></div>
```

A div element in a paragraph position. Storage keeps it, and the conversion keeps the paragraph only.

Rendered view (HTML):

```html
<div><p>in a div</p></div>
```

Storage format after the round trip through ADF:

```xml
<p>in a div</p>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<p><script>alert(1)</script>after script</p>
```

A script element. It is removed when the page is first saved, before any conversion.

Rendered view (HTML):

```html
<p>after script</p>
```

Storage format after the round trip through ADF:

```xml
<p>after script</p>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<ac:structured-macro ac:name="section"><ac:rich-text-body><ac:structured-macro ac:name="column"><ac:parameter ac:name="width">50%</ac:parameter><ac:rich-text-body><p>col 1</p></ac:rich-text-body></ac:structured-macro><ac:structured-macro ac:name="column"><ac:rich-text-body><p>col 2</p></ac:rich-text-body></ac:structured-macro></ac:rich-text-body></ac:structured-macro>
```

Two legacy macros that become layout elements in ADF. Macros with a native ADF node are rewritten into it.

Rendered view (HTML):

```html
<div class="sectionColumnWrapper conf-macro output-block" data-hasbody="true" data-macro-id="<id>" data-macro-name="section"><div class="sectionMacro"><div class="sectionMacroRow"><div class="columnMacro conf-macro output-block" data-hasbody="true" data-macro-id="<id>" data-macro-name="column" style="width:50%;min-width:50%;max-width:50%;"><p>col 1</p></div><div class="columnMacro conf-macro output-block" data-hasbody="true" data-macro-id="<id>" data-macro-name="column"><p>col 2</p></div></div></div></div>
```

Storage format after the round trip through ADF:

```xml
<ac:layout><ac:layout-section ac:type="two_equal" ac:breakout-mode="default"><ac:layout-cell><p>col 1</p></ac:layout-cell><ac:layout-cell><p>col 2</p></ac:layout-cell></ac:layout-section></ac:layout>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<ac:layout><ac:layout-section ac:type="two_equal"><ac:layout-cell><p>only one cell</p></ac:layout-cell></ac:layout-section></ac:layout>
```

A layout section that ADF cannot represent. The content survives inside a legacy-content extension, and storage loses the ac:layout wrapper.

Rendered view (HTML):

```html
<div class="contentLayout2">
<div class="columnLayout two-equal" data-layout="two-equal">
<div class="cell normal" data-type="normal">
<div class="innerCell">
<p>only one cell</p></div>
</div>
<div class="cell normal" data-type="normal">
<div class="innerCell">
<p></p></div>
</div>
</div>
</div>
```

Storage format after the round trip through ADF:

```xml
<ac:layout-section ac:type="two_equal"><ac:layout-cell><p>only one cell</p></ac:layout-cell></ac:layout-section>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<ac:structured-macro ac:name="bgcolor"><ac:parameter ac:name="colour">yellow</ac:parameter><ac:rich-text-body><p>bgcolor body</p></ac:rich-text-body></ac:structured-macro>
```

A legacy macro that has a native ADF node. It returns as a panel macro with explicit parameters.

Rendered view (HTML):

```html
<div class="conf-macro output-block" data-hasbody="true" data-macro-id="<id>" data-macro-name="bgcolor" style="background-color: #C0FFC0;">
    bgcolor body
</div>
```

Storage format after the round trip through ADF:

```xml
<ac:structured-macro ac:name="panel" ac:schema-version="1" ac:macro-id="<id>"><ac:parameter ac:name="containerLevel">panel_c1</ac:parameter><ac:parameter ac:name="bgColor">#C0FFC0</ac:parameter><ac:rich-text-body><p>bgcolor body</p></ac:rich-text-body></ac:structured-macro>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

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

A macro that stays a macro. ADF gives it a layout, and storage returns with a data-layout attribute.

Rendered view (HTML):

```html
<macro output not published: it lists pages, tasks or people from the site>
```

Storage format after the round trip through ADF:

```xml
<ac:structured-macro ac:name="attachments" ac:schema-version="1" data-layout="wide" ac:macro-id="<id>" />
```

Sent to Confluence Cloud on 29 Nov 2026.

## What changes in conversion

- Macros become extension nodes. A block macro is an extension, a macro with a body is a bodiedExtension, and an inline macro is an inlineExtension inside a paragraph. The macro name is the extensionKey, parameters sit under macroParams as {value} objects, and macroMetadata holds the macro id, the schema version and a title.
- The conversion adds data of its own. ADF carries a generated _parentId parameter, and the return trip writes a macro-id and a schema-version on each macro. The probes show these as <id> and a version number.
- Markup that ADF has no node for is dropped: a span with line-through styling, a plain div, a script. These do not come back.
- Some structures are kept raw. A layout section with too few cells is stored as a legacy-content extension, and a macro that fails to parse is stored in a migration extension with its original XML.
- Legacy macros with a native ADF equivalent are rewritten: bgcolor to a panel, noformat to a code macro. Symbol macros such as copyright become an empty paragraph.

## Pitfalls

- Compare both storage and view before and after an editor save. In the strikethrough and div probes, the view changed together with the storage.
- The strikethrough markup in the Atlassian storage format documentation is not an ADF construct. Text that uses it lost its styling in the probe.
- The macro id and the _parentId are generated. Do not compare two ADF documents of the same page without removing them.

## Questions and answers

### Is ADF round trip lossless?

Not for every element. Plain text, tables and most macros returned as written, while styled spans, div elements and symbol macros did not.

## Related

- [REST API body representations](https://goingstellar.ro/reference/confluence-storage-format/rest-api-representations/)
- [Macros removed from the Cloud editor](https://goingstellar.ro/reference/confluence-storage-format/legacy-macros/)
- [Unknown and empty macros](https://goingstellar.ro/reference/confluence-storage-format/unknown-macros/)
- [section and column macros](https://goingstellar.ro/reference/confluence-storage-format/section-column/)
- [html, iframe and widget macros](https://goingstellar.ro/reference/confluence-storage-format/html-iframe-widget/)

## 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/)

