# JSON Formatting & Display in Confluence: Code Blocks vs Structure Viewer

May 10, 2026 ·

<!-- -->

4 min read

[NGPilot](https://ngpilot.com)

Confluence's native code block macro renders JSON as plain text with no real formatting, no themes, and no copy button. There are two purpose-built apps that fix this, and each serves a different JSON display need:

* **[Modern Code Blocks for Confluence](/docs/Modern-Code-Blocks-for-Confluence/user-docs.md)** — renders JSON as **syntax-highlighted code** with the Monaco editor (VS Code engine), 50+ themes, line numbers, copy button, and dark/light mode. **Best for API docs, snippets, and most JSON display.**
* **[JSON Structure Viewer for Confluence](/docs/json-structure-viewer-for-confluence/usage.md)** — renders JSON as an **interactive collapsible tree** you can zoom and rotate. **Best for exploring large, deeply nested structures.**

This guide compares the two so you can pick the right one for each page.

## Modern Code Blocks: syntax-highlighted JSON[​](#modern-code-blocks-syntax-highlighted-json "Direct link to Modern Code Blocks: syntax-highlighted JSON")

[Modern Code Blocks for Confluence](https://marketplace.atlassian.com/apps/3525717923/modern-code-blocks-for-confluence) uses the Monaco editor — the same engine behind VS Code — to render JSON with proper syntax highlighting. Keys, strings, numbers, booleans, and null each get distinct colors, and you can switch between 50+ themes (Monokai, Dracula, GitHub Dark, Solarized) or let the block auto-match Confluence's light/dark mode.

### Features for JSON[​](#features-for-json "Direct link to Features for JSON")

* **Monaco-grade highlighting** — distinct colors for keys, strings, numbers, booleans, null
* **50+ themes** — or Auto, which follows Confluence dark/light mode
* **Line numbers** — readers can reference "line 42"
* **Copy button** — one-click copy of the payload
* **Window chrome** — optional macOS/Windows title bar with auto-derived filename (`config.json`)
* **Diff view** (Advanced edition) — show a JSON config change as a colored before/after
* **85+ languages** — the same macro handles JSON, YAML, SQL, Python, and more

### How to format JSON with Code Blocks[​](#how-to-format-json-with-code-blocks "Direct link to How to format JSON with Code Blocks")

1. Install [Modern Code Blocks](https://marketplace.atlassian.com/apps/3525717923/modern-code-blocks-for-confluence) from the Marketplace (free for up to 10 users)
2. Edit a Confluence page, type `/code` and select **Modern Code Blocks for Confluence**
3. Paste your JSON into the editor
4. Set the **Language** to **JSON**
5. Optionally pick a **Theme**
6. Save the macro

Example — an API response rendered with JSON syntax highlighting:

```
{

  "users": [

    {"id": 1, "name": "Alice", "role": "admin"},

    {"id": 2, "name": "Bob", "role": "editor"}

  ],

  "pagination": {"page": 1, "total": 42}

}
```

For the full configuration reference — themes, max height, font size, minimap, window chrome, diff mode — see the [Modern Code Blocks user guide](/docs/Modern-Code-Blocks-for-Confluence/user-docs.md).

## JSON Structure Viewer: interactive tree[​](#json-structure-viewer-interactive-tree "Direct link to JSON Structure Viewer: interactive tree")

[JSON Structure Viewer for Confluence](https://marketplace.atlassian.com/apps/1237254/json-structure-viewer-for-confluence) renders JSON as an interactive visual tree. Readers click nodes to expand and collapse, and use a toolbar to zoom and rotate. Use it when the JSON is too large or nested to read line-by-line and readers need to explore the shape of the data.

### When to use the tree view[​](#when-to-use-the-tree-view "Direct link to When to use the tree view")

* A 500-line configuration file readers must navigate
* Showing the hierarchical *shape* of a data model
* Exploring an API response with many nested arrays

To use it, install JSON Structure Viewer, type `/json` on a page, and paste your JSON. See the [JSON Structure Viewer docs](/docs/json-structure-viewer-for-confluence/usage.md).

## Comparison: which should you use?[​](#comparison-which-should-you-use "Direct link to Comparison: which should you use?")

| Feature                   | Modern Code Blocks            | JSON Structure Viewer        |
| ------------------------- | ----------------------------- | ---------------------------- |
| **Render style**          | Syntax-highlighted code       | Interactive collapsible tree |
| **Highlighting**          | Monaco engine, 50+ themes     | Color-coded keys/values      |
| **Line numbers**          | Yes                           | No (tree view)               |
| **Copy button**           | Yes                           | No                           |
| **Zoom & rotate**         | No                            | Yes                          |
| **Expand/collapse nodes** | No (scroll instead)           | Yes                          |
| **Themes**                | 50+ (Monokai, Dracula, …)     | Dark/light auto              |
| **Diff view**             | Yes (Advanced)                | No                           |
| **Other languages**       | 85+ (YAML, SQL, Python, …)    | JSON only                    |
| **Best for**              | API docs, snippets, most JSON | Large nested structures      |

For most Confluence pages — API docs, config examples, tutorials — **Modern Code Blocks is the better default** because readers want to copy the payload and read it with familiar IDE-style highlighting. Add JSON Structure Viewer when a structure is too large to read as text and readers need to explore it as a tree.

## Related resources[​](#related-resources "Direct link to Related resources")

* [Modern Code Blocks — marketplace](https://marketplace.atlassian.com/apps/3525717923/modern-code-blocks-for-confluence) | [documentation](/apps/modern-code-blocks-for-confluence.md)
* [JSON Structure Viewer — marketplace](https://marketplace.atlassian.com/apps/1237254/json-structure-viewer-for-confluence) | [documentation](/apps/json-structure-viewer-for-confluence.md)
* [How to display and format JSON in Confluence](/blog/embed-json-confluence.md) — deeper how-to guide
* [Advanced code blocks in Confluence](/blog/advanced-code-blocks-confluence.md) — themes, performance, diff view
* [Best Confluence apps for developers](/blog/best-confluence-apps-developers.md)

Try <!-- -->JSON Structure Viewer for Confluence

Visualize JSON as interactive structure diagrams — free for up to 10 users.

[Get it on the Atlassian Marketplace](https://marketplace.atlassian.com/apps/1237254/json-structure-viewer-for-confluence?utm_source=ngpilot.com\&utm_medium=website\&utm_campaign=json-structure-viewer-for-confluence)

## Related guides

* [How to Create Mermaid Diagrams in Jira](/blog/how-to-create-mermaid-diagrams-jira.md)
* [Export Jira Issues to Excel or CSV](/blog/export-jira-issues-to-excel.md)
* [Bulk Download Jira Attachments](/blog/bulk-download-jira-attachments.md)
* [How to Migrate Confluence Content](/blog/how-to-migrate-confluence-content.md)

Explore NGPILOT[Browse Solutions](/solutions.md)[All Apps](/apps.md)[Atlassian Marketplace →](https://marketplace.atlassian.com/vendors/1226848/?utm_source=ngpilot.com\&utm_medium=blog\&utm_campaign=hub-links)

**Tags:**

* [confluence](/blog/tags/confluence.md)
* [json](/blog/tags/json.md)
* [json-schema](/blog/tags/json-schema.md)
* [api-documentation](/blog/tags/api-documentation.md)
* [code-blocks](/blog/tags/code-blocks.md)
