## [How to Display & Format JSON in Confluence (Code Blocks + Viewer)](/blog/embed-json-confluence.md)

April 24, 2026 ·

<!-- -->

4 min read

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

Confluence's native code block macro renders JSON as plain text — no real syntax highlighting, no themes, no copy button. For API documentation, config references, or any page where JSON needs to be readable, that's not good enough. There are two better ways to embed JSON in Confluence, and the best one depends on how you want readers to interact with the data.

Two approaches

1. **[Modern Code Blocks](/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 use cases.**
2. **[JSON Structure Viewer](/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.**

**Tags:**

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

[**Read more**](/blog/embed-json-confluence.md)
