# Headings (h1 to h6) in Confluence storage format

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

Confluence storage format uses the plain XHTML elements h1 to h6, with no wrapper and no attributes. The rendered view adds an id to each heading, built from the page title and the heading text. A seventh level does not exist, and the tag is stripped without an error.

## Storage format

```xml
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h6>Heading 6</h6>
```

## As ADF (Confluence Cloud)

The ADF that Confluence Cloud builds for:

```xml
<h1>Heading 1</h1>
```

```json
{
 "type": "doc",
 "content": [
  {
   "type": "heading",
   "attrs": {
    "level": 1
   },
   "content": [
    {
     "text": "Heading 1",
     "type": "text"
    }
   ]
  }
 ],
 "version": 1
}
```

## Examples

Storage format sent:

```xml
<h1>Heading 1</h1>
```

The standard first-level heading, as written in the storage format documentation. The view adds an id so the heading can be linked to.

Rendered view (HTML):

```html
<h1 id="Examplepage-Heading1">Heading 1</h1>
```

Storage format after the round trip through ADF:

```xml
<h1>Heading 1</h1>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<h6>Heading 6</h6>
```

Level 6 is the lowest level. Levels 4 and 5 follow the same pattern, so one probe stands for the whole range.

Rendered view (HTML):

```html
<h6 id="Examplepage-Heading6">Heading 6</h6>
```

Storage format after the round trip through ADF:

```xml
<h6>Heading 6</h6>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<h7>Heading 7</h7>
```

A level that does not exist. Confluence stores the bare text with the tag removed, and the next ADF save wraps it in a paragraph.

Rendered view (HTML):

```html
Heading 7
```

Storage format after the round trip through ADF:

```xml
<p>Heading 7</p>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<h1><strong>bold heading</strong></h1>
```

Inline formatting inside a heading. The strong element survives both the storage save and the ADF round trip.

Rendered view (HTML):

```html
<h1 id="Examplepage-boldheading"><strong>bold heading</strong></h1>
```

Storage format after the round trip through ADF:

```xml
<h1><strong>bold heading</strong></h1>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

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

Alignment is a style on the heading element itself. It survives the ADF round trip as an alignment mark.

Rendered view (HTML):

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

Storage format after the round trip through ADF:

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

Sent to Confluence Cloud on 29 Nov 2026.

## What changes in conversion

- Levels 1 to 6 map to an ADF heading node with a level attribute, and every level tested came back from an ADF save as the same element.
- The id in the view is not part of the stored markup. It is added at render time and is built from the page title and the heading text with the spaces removed.
- Bold inside a heading and text-align on the heading both survive the round trip. Alignment travels as an alignment mark on the heading node.
- A tag outside h1 to h6 is not converted. The text stays and the element is gone, and an ADF save then puts the text in a paragraph.

## Pitfalls

- Do not look for the heading id in storage. It appears only in the rendered view.
- An h7 or any other invented level is removed silently. The save succeeds and the text loses its heading status.
- Heading ids are generated, so read them from the view when a tool needs them, not from the stored markup.

## Questions and answers

### How many heading levels does Confluence storage format support?

Six, h1 to h6. An h7 element is removed and its text is kept without a wrapper.

### Can a heading be centered in storage format?

Yes. Put style="text-align: center;" on the heading element. The attribute survives an ADF round trip.

## Related

- [<strong>, <em>, <b> and <i>](https://goingstellar.ro/reference/confluence-storage-format/bold-italic/)
- [Alignment and indentation](https://goingstellar.ro/reference/confluence-storage-format/alignment-indentation/)
- [Paragraphs, line breaks and <hr>](https://goingstellar.ro/reference/confluence-storage-format/paragraphs-line-breaks/)
- [HTML that storage format drops](https://goingstellar.ro/reference/confluence-storage-format/unsupported-html/)
- [toc and toc-zone macros](https://goingstellar.ro/reference/confluence-storage-format/table-of-contents/)

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

