Skip to main content
DeepL bills by the number of characters in your source text, measured in Unicode code points. “A”, “Δ”, “あ”, and “深” each count as one character. This means you can estimate your usage entirely on your own, without calling the API. All you need is access to your content. This guide walks through techniques for counting characters in different content types, projecting monthly usage, and validating your estimates.

Before you start

DeepL bills by source-text length in Unicode code points. Characters in the context parameter and HTML/XML tags (when tag handling is enabled) do not count. For the full billing rules and per-document character minimums, see Usage and limits.

Estimate website content

You don’t need to crawl your entire site. Pick 5-10 representative pages (a mix of short and long ones), count the characters on each, and use the average to extrapolate across your total page count. The script below strips HTML from a page and returns the character count. Run it against a handful of URLs to get your average.
Then multiply the average by your total number of pages:
If you want an exact count instead of a sample-based estimate, you can extend the script to crawl your full sitemap or use a crawler like Scrapy to discover all pages automatically.

Estimate from a CMS or database

If your content lives in a CMS or a database, query it directly. This is often the most accurate approach because it reflects exactly what you’ll send to the API. Most CMSes (Drupal, WordPress, Contentful, etc.) do not provide a built-in way to see total word or character counts across all published content. You’ll typically need to query the underlying database or use the CMS export/API to pull content and count locally.
For a Drupal site specifically, the node_field_data and node__body tables contain page titles and body content. For WordPress, query the wp_posts table filtering on post_status = 'publish'.

Estimate document content

For documents you plan to translate via the Document Translation API, you can extract text locally to get a rough character count.
For PDFs, use a library like PyMuPDF or pdfplumber to extract text. Keep in mind that your local count is an approximation. DeepL’s document processing pipeline may extract text differently than a local script, for example, by reading text embedded in images or charts via OCR. Treat your local count as a lower bound. Per-document character minimums apply for certain file formats, so the billed count may be higher than the actual text content.

Project monthly usage

Once you know your total source characters, multiply by the number of target languages and your expected update frequency.
For example, a website with 500,000 source characters translated into 5 languages with ~10% of pages updated monthly:
If you’re translating the same content into multiple languages, each language counts separately toward your character usage.

Validate your estimate

Once you’ve estimated your characters, you can sign up for a DeepL API plan for free and test a small sample against the live API. Use the show_billed_characters parameter to compare actual billed characters against your local count. DeepL intends to include billed_characters in responses by default in the future, with advance notice to API users before the change.
Run this on 5-10 representative pages or documents and compare the billed_characters value against your local character count. They should be very close. Differences typically come from HTML tags or whitespace that your local extraction handles differently than the API.

Monitor actual usage

After you start translating, monitor actual usage against your estimates:
  • /v2/usage endpoint - programmatic access to your current billing period consumption
  • Usage Analytics Dashboard - visualize usage across API keys with the open-source demo dashboard
  • API Usage Logger - per-request logging with billed characters, language pairs, and reporting tags
  • Cost Control - set a monthly character limit on your Pro API subscription to cap spend