This guide shows you:Documentation Index
Fetch the complete documentation index at: https://deepl-c950b784-customizations-with-variants.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
- When to use
context(and when not to) - How to use
contextto resolve ambiguous words, genders, or transliterations - How to choose between
context, Glossaries, and Style Rules
What the context parameter is for
Thecontext parameter helps DeepL’s API translate ambiguous words and short text snippets more accurately by providing the surrounding content. Think of it like showing a human translator the paragraphs before and after the sentence being translated.
The context parameter can help with:
- Picking the correct translation for ambiguous words
- Providing grammatical clues for gender, number, or case that isn’t clear from the text alone
- Improving translations of short snippets such as headlines or product names
What the context parameter is NOT for
Thecontext parameter is not designed for:
- LLM-style instructions: “Translate with a friendly, casual tone”
- Translation rules: “Always translate ‘Tor’ as ‘gate’”
- Cultural context: “Adapt for German cultural norms”
context like this will produce unpredictable results. The parameter is optimized for document content, not commands.
Instead, try:
- Style rules and custom instructions: For tone, style, formatting, and translation instructions
- Glossaries: For consistent terminology and brand names
How to use context for ambiguous words
When a word has multiple meanings, surrounding context helps the translation engine choose the correct interpretation.Example
“Tor” could mean “gate” or “goal” in German. Without context, DeepL may not know which meaning you intend:When to use this approach
- You’re translating short snippets that lack built-in context
- The text contains words with multiple meanings
- The surrounding content makes the intended meaning clear
How to use context for grammatical gender
When grammatical gender isn’t clear from the source text, context can provide the necessary clues.Example
Without context, DeepL may not use the desired gender when translating:When to use this approach
- Translating into languages with grammatical gender
- The source text doesn’t specify gender
- You have surrounding sentences that contain gender clues
How to use context for consistent name translation
When translating names in headlines or short snippets, the same name might be transliterated differently unless additional context is provided.Example
As noted in thetext field reference, each text in the array is translated independently and texts do not share context with each other. This results in different transliterations for the name “Sergej”.
context containing the complete name results in consistent transliteration:
When to use this approach
- Translating news headlines separately from article bodies
- Transliterating names with multiple possible spellings in your target language
Choosing the right feature for your needs
Different DeepL features solve different problems. Use this table to decide which best suits your use case.| Use Case | Context Parameter | Glossaries | Style Rules |
|---|---|---|---|
| Ambiguous words | ✅ | ❌ | ❌ |
| Consistent gender or spelling | ✅ | ❌ | ❌ |
| Consistent domain-specific terminology | ❌ | ✅ | ❌ |
| Brand names | ❌ | ✅ | ❌ |
| Tone and style | ❌ | ❌ | ✅ |
| Formatting rules | ❌ | ❌ | ✅ |
| Translation instructions | ❌ | ❌ | ✅ |
Technical details
Cost
Characters in thecontext parameter do not count toward billing. Only characters sent in the text parameter are billed.
Size limit
There is no size limit for thecontext parameter itself, but the request body size limit of 128 KiB applies to all text translation requests.
Multi-text requests
As noted in the text field reference, each text in the array is translated independently — they do not share context with each other.
In this example, “Tor” might be translated as “gate” instead of “goal” because the first text doesn’t have access to the second one’s content.
context parameter, or keep related content together in one text parameter.
If you send a request with both context and multiple text parameters, the context parameter will be applied to each one.
Document translation
When using the document translation endpoint, the engine automatically uses the broader document context. You don’t need to provide explicit context for full documents.Tag handling
When usingtag_handling=xml or tag_handling=html, tags are not used as a context boundary. The translation engine automatically looks across all content provided in each text parameter. As with other types of texts, you may need to provide additional context when translating single tags without surrounding content.
Next steps
Now that you understand the context parameter:- Try it yourself: Review the text translation API reference for complete context parameter specifications
- Enforce terminology: Learn how to use glossaries for consistent translations across all content
- Control style and tone: Explore style rules for formatting and tone instructions
- Translate full documents: Understand how document translation automatically handles context