# Alignment and indentation in Confluence storage format

URL: https://goingstellar.ro/reference/confluence-storage-format/alignment-indentation/

Alignment is a text-align style on a paragraph or heading. Indentation is a margin-left style in steps of 30 pixels. Both map to ADF marks and round-trip. The legacy align and center macros stay as macros.

## Storage format

```xml
<p style="text-align: center;">centered text</p>
<p style="text-align: right;">right aligned text</p>
<p style="margin-left: 30.0px;">indented</p>
```

## In the editor

- Use the native align options in the toolbar. Per the Atlassian documentation, as the replacement for the Align and Center macros.

## As ADF (Confluence Cloud)

The ADF that Confluence Cloud builds for:

```xml
<p style="text-align: center;">centered text</p>
```

```json
{
 "type": "doc",
 "content": [
  {
   "type": "paragraph",
   "marks": [
    {
     "type": "alignment",
     "attrs": {
      "align": "center"
     }
    }
   ],
   "content": [
    {
     "text": "centered text",
     "type": "text"
    }
   ]
  }
 ],
 "version": 1
}
```

## Examples

Storage format sent:

```xml
<p style="text-align: center;">centered text</p>
```

Centered paragraph as written in the documentation. The ADF mark has the align value center.

Rendered view (HTML):

```html
<p style="text-align: center;">centered text</p>
```

Storage format after the round trip through ADF:

```xml
<p style="text-align: center;">centered text</p>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<p style="text-align: right;">right aligned text</p>
```

Right-aligned paragraph. In ADF the same alignment is the value end.

Rendered view (HTML):

```html
<p style="text-align: right;">right aligned text</p>
```

Storage format after the round trip through ADF:

```xml
<p style="text-align: right;">right aligned text</p>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<p style="margin-left: 30.0px;">indented</p>
```

A first level of indent, 30 pixels, kept in storage with one decimal place.

Rendered view (HTML):

```html
<p style="margin-left: 30.0px;">indented</p>
```

Storage format after the round trip through ADF:

```xml
<p style="margin-left: 30.0px;">indented</p>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
ADF:{"content": [{"content": [{"text": "Indented twice", "type": "text"}], "marks": [{"attrs": {"level": 2}, "type": "indentation"}], "type": "paragraph"}], "type": "doc", "version": 1}
```

An ADF paragraph with indentation level 2. Confluence writes a margin-left of 60 pixels.

Rendered view (HTML):

```html
<p style="margin-left: 60.0px;">Indented twice</p>
```

Storage format after the round trip through ADF:

```xml
<p style="margin-left: 60.0px;">Indented twice</p>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
ADF:{"content": [{"attrs": {"level": 2}, "content": [{"text": "Centered", "type": "text"}], "marks": [{"attrs": {"align": "center"}, "type": "alignment"}], "type": "heading"}], "type": "doc", "version": 1}
```

Alignment on a heading set in ADF. It is written as a text-align style on the heading element.

Rendered view (HTML):

```html
<h2 style="text-align: center;" id="Examplepage-Centered">Centered</h2>
```

Storage format after the round trip through ADF:

```xml
<h2 style="text-align: center;">Centered</h2>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<ac:structured-macro ac:name="align"><ac:parameter ac:name="alignment">center</ac:parameter><ac:rich-text-body><p>align body</p></ac:rich-text-body></ac:structured-macro>
```

The legacy align macro. It survives an ADF save, but the view shows text-align: justify for the value center.

Rendered view (HTML):

```html
<div class="conf-macro output-block" data-hasbody="true" data-macro-id="<id>" data-macro-name="align" style="text-align: justify;"><p>align body</p></div>
```

Storage format after the round trip through ADF:

```xml
<ac:structured-macro ac:name="align" ac:schema-version="1" ac:macro-id="<id>"><ac:parameter ac:name="alignment">center</ac:parameter><ac:rich-text-body><p>align 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="center"><ac:rich-text-body><p>center body</p></ac:rich-text-body></ac:structured-macro>
```

The legacy center macro. It survives as a macro and renders with text-align: center.

Rendered view (HTML):

```html
<div class="conf-macro output-block" data-hasbody="true" data-macro-id="<id>" data-macro-name="center" style="text-align:center;"><p>center body</p></div>
```

Storage format after the round trip through ADF:

```xml
<ac:structured-macro ac:name="center" ac:schema-version="1" ac:macro-id="<id>"><ac:rich-text-body><p>center body</p></ac:rich-text-body></ac:structured-macro>
```

Sent to Confluence Cloud on 29 Nov 2026.

## What changes in conversion

- text-align on a paragraph or heading maps to the ADF alignment mark. center stays center and right is stored in ADF as end. All are written back as the same style.
- margin-left in multiples of 30 pixels maps to the ADF indentation mark, one level per 30 pixels. Level 2 is stored as margin-left: 60.0px.
- The align and center macros remain macros with their body after the ADF round trip, which matches the removed-macros page.

## Pitfalls

- Only centre and right alignment were probed. Left alignment was not tested.
- Prefer the style to the macros. The documentation points to the toolbar alignment options as the replacement for both macros.
- The align macro with alignment set to center rendered as justify in the probe, so check the value list before relying on it.

## Questions and answers

### How is a right-aligned paragraph stored in ADF?

As an alignment mark with the value end. Storage writes it back as text-align: right.

## Related

- [<h1> to <h6> headings](https://goingstellar.ro/reference/confluence-storage-format/headings/)
- [Paragraphs, line breaks and <hr>](https://goingstellar.ro/reference/confluence-storage-format/paragraphs-line-breaks/)
- [<blockquote>](https://goingstellar.ro/reference/confluence-storage-format/block-quote/)
- [Macros removed from the Cloud editor](https://goingstellar.ro/reference/confluence-storage-format/legacy-macros/)
- [<ul> and <ol> lists](https://goingstellar.ro/reference/confluence-storage-format/bullet-numbered-lists/)

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

