TCF Consent String Encoder

Build an IAB TCF v2.2 Transparency & Consent (TC) string from CMP settings, purpose consents, special features and vendor ids — encoded in your browser.

The TCF Consent String Encoder runs entirely in your browser. Your CMP settings, purpose selections and vendor ids are encoded on your device, no Global Vendor List is fetched, and nothing is uploaded to ArrayKit.

Open the TCF Consent Decoder

About TCF Consent String Encoder

The TCF Consent String Encoder builds an IAB TCF v2.2 Transparency & Consent (TC) string from a form: set your CMP ID, CMP version, consent screen, consent language, vendor list version and TCF policy version, then toggle purpose consents (1-11), purpose legitimate interests, special feature opt-ins and a list of vendor consent ids. It assembles a valid TCModel and produces the base64url TC string you can paste into a CMP fixture, a Prebid config, an ad request, or a QA test. It is handy when ad-ops engineers and CMP developers need a deterministic string to reproduce a consent scenario or debug why a demand partner is being dropped. Every field is encoded on your device — no CMP API is called and no global vendor list is fetched from the network, so test consent data never leaves your browser.

Features

How to use the TCF Consent String Encoder

  1. Enter your CMP ID, CMP version, consent screen and two-letter consent language
  2. Set the vendor list version, TCF policy version and the storage scope toggle
  3. Check the purposes, legitimate interests and special features the user opted into
  4. Type the vendor consent ids as a comma-separated list
  5. Copy the encoded TC string and drop it into your CMP, ad request or test fixture

Example

Input

cmpId: 300, cmpVersion: 1, lang: EN
purposeConsents: 1,2,3,4,7
vendorConsents: 1,8,755

Output

COzTVhaOzTVhaGvAAAENAiCIAP_AAH_AAAAAAAAA... (base64url TC string)

The selected purposes and vendor ids are packed into a TCF v2.2 core string.

Common errors & troubleshooting

Frequently asked questions

What is a TCF consent string encoder?
It is a tool that turns CMP settings and user consent choices — purposes, legitimate interests, special features and vendor ids — into an IAB TCF v2.2 Transparency & Consent (TC) string, the base64url value CMPs pass to vendors and ad requests.
Which TCF version does this encoder produce?
It builds TCF v2.2 core strings. You control the TCF policy version and vendor list version fields, and the output is a standard base64url TC string that TCF-aware CMPs and decoders can read.
How do I add vendor consents to the string?
Type the IAB vendor ids into the vendor consent field as a comma- or space-separated list (for example 1, 8, 755). Each id is encoded into the vendor-consent section of the TC string.
Why must the consent language be two letters?
The TCF spec stores the consent language as a two-character ISO-639-1 code. The encoder uppercases and validates your input, so enter codes like EN, FR or DE rather than full language names.
Does encoding fetch the Global Vendor List from a server?
No. To stay fully in your browser, the tool builds a minimal in-memory vendor list from the ids you enter instead of downloading the GVL. Your CMP settings and vendor ids are never sent anywhere.
Can I decode a string I built here?
Yes. Paste the encoded output into the TCF Consent Decoder to inspect the CMP fields, purposes and vendors and confirm the string round-trips as expected.

Related tools

All ArrayKit tools