Skip to content

Main content

Ad Copy Truncation Ellipsis Budget

Truncate explicit ad copy to a supplied Unicode code-point budget reserving room for a supplied ellipsis without assuming grapheme or display width.

Loading tool…

Description

Truncate supplied ad copy to a code-point budget with a chosen ellipsis.

Advertising records distinguish nominal reach, impressions, visibility thresholds, disclosure order and content budgets. New unique people are supplied rather than deduplicated, and caption duration alone does not establish accessibility. Code-point truncation can split a grapheme even when it meets a numeric text budget.

Truncate supplied ad copy to a code-point budget with a chosen ellipsis.

When to use this tool

Use Ad Copy Truncation Ellipsis Budget when you already have copyText, maximumCodePoints, ellipsis and need to truncate supplied ad copy to a code-point budget with a chosen ellipsis.

How to use the tool and how it works

  1. Enter copyText, maximumCodePoints, ellipsis. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read displayText, truncated. Inspect truncated before interpreting the associated values.

Require maximumCodePoints nonnegative safe whole; count Array.from(copyText). Preserve text if already within budget; otherwise require ellipsis code-point length<=budget, reserve it and append it to the retained prefix.1

Input fieldMeaning and unitsAccepted input
copyTextCopy TextRequired. Text; maximum UTF-16 length 8192.
maximumCodePointsBudget in Array.from code points, not graphemes or display width.Required. Safe integer; minimum 0.
ellipsisLiteral suffix reserved only when truncating; may be empty or longer than budget when no truncation is needed.Required. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
displayTextDisplay TextRequired. Text; maximum UTF-16 length 8192.
truncatedTruncatedRequired. Boolean.
json
{
  "input": {
    "copyText": "Hello world",
    "maximumCodePoints": 8,
    "ellipsis": "…"
  },
  "output": {
    "displayText": "Hello w…",
    "truncated": true
  }
}

Limitations and assumptions

  • Ellipsis length is checked only when truncating; empty ellipses are accepted. Code points differ from graphemes, bytes and display width, so combining sequences can be split and no layout or legal adequacy is assessed.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Review actual audience, media, creative and transaction records with the complete measurement and applicable disclosure rules. Verify definitions and rendering before interpreting local counts or flags as effectiveness, billable delivery or compliance.

References

  1. Calculation and input contract: advertising/ad-copy-truncation-ellipsis-budget — tool.io

Similar or alternative tools