---
source: https://carbone.io/documentation/design/advanced-features/hyperlinks.html
title: "Dynamic Hyperlinks in Documents | Carbone Templating Guide | Embed & Validate URLs in DOCX, XLSX, and PPTX"
description: "How to add dynamic hyperlinks to your documents?"
generated_at: "2026-07-08"
---

# Hyperlinks

How to add dynamic hyperlinks to your documents?  
ENTERPRISE FEATURE Available for:  
✓ Carbone Cloud  
✓ Carbone On-premise  
✗ Embedded Carbone JS   v3.0+ 

With Carbone, you can seamlessly integrate hyperlinks into various elements of your DOCX, XLSX, PPTX, ODT, ODS, ODP, and ODG templates.

## How to include Hyperlinks?

Hyperlinks can be dynamically applied to various elements such as text, images, tables, and lists within your documents. Follow these steps to insert hyperlinks:

1.  **Select the Element**: Right-click on the text, image, table, or list item you want to hyperlink.
2.  **Insert Hyperlink**: Choose the "Hyperlink" option from the context menu.
3.  **Enter the Carbone Tag**: Input the appropriate Carbone tag and confirm your selection.

**Important Notes:**

-   **Automatic Character Replacement**: If your text editor automatically replaces curly braces with special characters like %256B, this will not affect the functionality.
-   **Static and Dynamic URL Mixing**: It is not feasible to combine a static URL with a dynamic URL tag (e.g., `https://carbone.io{d.url}`). In such cases, Carbone will retain only the dynamic part `{d.url}`.
-   **XLSX Compatibility**: For XLSX files, ensure the tag is not enclosed in curly braces. For instance, use `d.url` instead of `{d.url}`. If `http://` appears before `d.url`, it will work.

## Hyperlink validation

Before dynamically injecting hyperlinks into your reports, Carbone performs a validation check to ensure the URL format is correct. A valid URL must include:

-   **Protocol (Optional)**: Either `http://` or `https://`. If omitted, Carbone will automatically prepend `https://`.
-   **Root Domain (Required)**: A root domain with a length between 2 and 256 characters.
-   **Top-Level Domain (TLD) (Required)**: Such as `.com`, `.org`, `.fr`, etc.

If the URL fails to meet these criteria, it will be replaced with the default URL: `https://carbone.io/documentation.html#hyperlink-validation`

## :defaultURL(url)

If a **dynamic hyperlink** or an **HTML anchor tag** fails the URL verification, you can use the `:defaultURL` formatter to specify a fallback URL. This ensures that invalid URLs are replaced with a valid alternative.

If a **dynamic hyperlink** or an **HTML anchor tag** is injected into a report and the URL verification fails, the `:defaultURL` formatter can be used to replace the default error URL. If the provided URL isn’t valid, it will be replaced with `https://carbone.io/documentation.html#hyperlink-validation`.

When inserting dynamic hyperlinks, chain the `:defaultURL` formatter to the tag, like this:

```text
{d.url:defaultURL('https://carbone.io')}
```

It is possible to pass another tag as a dynamic argument:

```text
{d.url:defaultURL(.urlOnError)}
```

When using the `:html` formatter, the `:defaultURL` should be placed before:

```text
{d.content:defaultURL(.urlOnError):html}
```

## Related topics

- [Translations i18n](/documentation/design/advanced-features/translations-i18n.md)
- [Transform](/documentation/design/advanced-features/transform.md)
- [Digital signatures](/documentation/design/advanced-features/signatures.md)
- [Pictures](/documentation/design/advanced-features/pictures.md)
- [Pagination](/documentation/design/advanced-features/pagination.md)
- [Key-value mapping](/documentation/design/advanced-features/key-value-mapping.md)
