---
title: "Labels"
description: "You can attach a descriptive text label to specific dice rolls or calculated expressions within your formula using square brackets `[ ]` immediately following the component you want to label."
canonical: "https://www.questportal.com/documentation/PH-rOkFbx3/labels"
section: "Documentation / Dice / Roll Formulas"
source: "Quest Portal documentation"
version: 237
---

# Labels

You can attach a descriptive text label to specific dice rolls or calculated expressions within your formula using square brackets \`\[ \]\` immediately following the component you want to label.

These labels are useful for identifying parts of a complex roll in user interfaces or logs (e.g., showing which part was the attack and which was the damage). The label text itself does not affect the calculation's numeric result.

**Examples:**

- \`2d6\[damage\]\` - Rolls 2d6 and attaches the label "damage" to the result.
- \`1d20+5\[attack\]\` - Calculates \`1d20+5\` and attaches the label "attack".
- \`(1d10+1d8)\[total bonus\]\` - Calculates the sum and attaches the label "total bonus" to the result of the grouped expression.
- \`{1d6\[fire\], 1d6\[cold\]}k1\` - Rolls fire damage and cold damage separately, labels each, and then keeps the higher of the two results. The labels remain associated with their original rolls.

**Note:** These explicit \`\[label\]\` tags are different from the "Root Label" discussed in the next section, which captures any text appearing at the very end of the entire formula string.

- [Root Label](https://www.questportal.com/documentation/y7rUxGFYcF/root-label)

---

Part of the [Quest Portal documentation](https://www.questportal.com/documentation.md) (Documentation / Dice / Roll Formulas). HTML version: <https://www.questportal.com/documentation/PH-rOkFbx3/labels>.
