---
title: "How to edit in ADF (JSON) and Storage (XHTML)"
canonical: "https://support.appfire.com/space/SOURCE/3450011727/How%20to%20edit%20in%20ADF%20(JSON)%20and%20Storage%20(XHTML)"
format: markdown
---
## Overview

Source Editor for Confluence lets you edit Confluence page source using either:

- **Storage (XHTML)** — the traditional Confluence storage format.
- **ADF (JSON)** — Atlassian Document Format, used by the modern Confluence editor.

Both formats can edit the same Confluence page. Switching formats changes only how the page source is represented.

> ℹ️ You must have permission to edit the page before you can modify its source.

## Choose a source format

Use the **format toggle** in the toolbar to switch between Storage (XHTML) and ADF (JSON).

| Current format | Button label | Result |
| --- | --- | --- |
| ADF (JSON) | **HTML** | Switches to Storage (XHTML). |
| Storage (XHTML) | **ADF** | Switches to ADF (JSON). |

When you switch formats:

- The editor reloads the page source.
- Syntax highlighting changes automatically.
- The selected format is used for preview and saving.

Note the following:

- The format toggle is unavailable while Preview is open.
- New editing sessions begin in Storage (XHTML).
- The editor remembers your most recently selected format.

![Source Editor for Confluence - The format toggle for ADF or Storage](media://7bad7dbd-8897-4e6c-b943-31cb356e125b)

## Choose the appropriate format

| Use Storage (XHTML) when: | Use ADF (JSON) when: |
| --- | --- |
| You work with existing storage markup. | You edit Atlassian Document Format directly. |
| You edit Confluence macros and storage snippets. | You build or troubleshoot ADF documents. |
| You prefer the traditional editing experience. | You need precise control over ADF nodes and marks. |

## Switch formats

Switching formats reloads the page from Confluence. If you have unsaved changes, Source Editor displays a confirmation dialog.

Choose:

- **Switch format** to discard unsaved changes.
- **Keep editing** to continue editing without switching.

If the reload fails, the editor remains in the current format.

![Source Editor for Confluence - switch source format message](media://ae7e0de3-400c-4be0-81fc-b593cde1d513)

## Edit pages in ADF (JSON)

When ADF mode is enabled, Source Editor displays the page as formatted JSON with syntax highlighting.

Available editing tools include:

| Feature | Description |
| --- | --- |
| Beautify | Formats valid JSON fir easier reading. |
| Preview | Converts ADF to HTML before displaying the rendered page. |
| Save | Validates the document and saves it as Atlassian Document Format. |

## Preview changes

Preview lets you review your changes before saving. In **Storage (XHTML)** mode, the editor converts the storage markup to HTML before displaying the page. In **ADF (JSON)** mode, the editor converts the Atlassian Document Format document to HTML using Confluence's content conversion service. Some macros may render differently in Preview than they do on the published page.

## Validate page source

Source Editor validates the document whenever you preview or save.

### ADF validation

The editor reports:

- Invalid JSON
- Invalid Atlassian Document Format documents
- Problems loading ADF documents

Correct the reported issues before saving.

### Storage validation

The editor reports:

- XHTML validation errors
- Invalid storage documents

The editor identifies the reported location so you can correct the markup. 

![Source Editor for Confluence - storage validation message](media://debde240-420b-4b84-beac-643d439f45cd)

## Save changes

When you save your changes, Source Editor saves the page using the currently selected source format. Pages edited in **Storage (XHTML)** mode are saved in the Confluence storage format, while pages edited in **ADF (JSON)** mode are validated and saved in the Atlassian Document Format. If you're editing a draft page, the draft is updated without changing the published version.

## Frequently asked questions

### Does switching formats change my page?

No.Switching formats changes only the source representation. The page changes only after you save.

### Is my preferred format remembered?

Yes. The editor remembers the last format used in your browser.

---

### Why did my edits disappear?

Switching formats reloads the page. If you chose **Switch format** without saving first, unsaved changes are discarded.