EMBEDDABLE WIDGET

Put a token counter in your blog post, docs, or app.

One iframe snippet adds a working token counter with live cost estimates to any page. It is free, requires no signup or API key, and the text your visitors type stays in their browser — the widget never uploads anything.

1. Paste the snippet

<iframe
  src="https://freetokencounter.com/widget"
  style="width:100%;max-width:680px;height:430px;border:1px solid #e5e5e5;border-radius:12px;"
  title="Free Token Counter"
  loading="lazy"></iframe>

Want it preset to a specific model? Add ?model=<model-id> to the src, for example /widget?model=claude-opus-4.8. Model ids are listed in the pricing API.

2. Add an attribution link (appreciated)

<p>Token counts powered by
  <a href="https://freetokencounter.com/">Free Token Counter</a>.</p>

The widget is free to embed anywhere. A plain link near it helps other people find the tool and keeps the project worth maintaining.

Live preview

Notes

Privacy. Text typed into the widget is tokenized in the visitor's browser. Nothing is sent to a server.

Accuracy. OpenAI models use exact in-browser tokenization; other providers are labeled estimates.

Pricing freshness. The widget reads the same auto-updated pricing catalog as the rest of the site.

Data instead of UI? Fetch current model prices as JSON from the free pricing API (CORS enabled).