Azure Translator is a cloud-based neural machine translation service that is part of Azure AI Services. It supports over 100 languages and dialects, enabling real-time text translation, transliteration, language detection, and dictionary lookups. Whether you are building a multilingual app, translating customer support tickets, or processing documents globally, Azure Translator provides a fast and accurate solution.
What is Azure Translator?
Azure Translator (formerly Microsoft Translator Text API) uses state-of-the-art neural machine translation (NMT) models to deliver high-quality translations. It offers:
- Text Translation: Translate text between supported languages in real time.
- Document Translation: Asynchronously translate entire documents (DOCX, PDF, XLSX, etc.) while preserving layout and formatting.
- Custom Translator: Train custom translation models using your domain-specific terminology and parallel corpora.
- Transliteration: Convert text from one script to another (e.g., Japanese Hiragana to Latin).
- Language Detection: Identify which language a piece of text is written in.
- Dictionary Lookup: Find alternative translations and example sentences.
Supported Languages
Azure Translator supports over 100 languages including English, Vietnamese, Chinese (Simplified/Traditional), Japanese, Korean, French, German, Spanish, Arabic, and many more. The full list is available via the /languages endpoint.
Setting Up Azure Translator
Step 1: Create a Translator Resource
- Go to the Azure Portal.
- Click Create a resource > AI + Machine Learning > Translator.
- Configure:
- Subscription and resource group.
- Region (choose Global or a specific region for data residency).
- Pricing tier: Free F0 (2M characters/month) or Standard S1.
- Click Review + Create and then Create.
- After deployment, copy the Key and Endpoint from the Keys and Endpoint tab.
Step 2: Install the SDK
# Python
pip install azure-ai-translation-text
# .NET
dotnet add package Azure.AI.Translation.Text
Text Translation
Python Example
from azure.ai.translation.text import TextTranslationClient
from azure.ai.translation.text.models import InputTextItem
from azure.core.credentials import AzureKeyCredential
credential = AzureKeyCredential("<your-translator-key>")
client = TextTranslationClient(credential=credential)
# Translate English to Vietnamese and Japanese
response = client.translate(
body=[InputTextItem(text="Hello, how are you?")],
to_language=["vi", "ja"],
from_language="en"
)
for translation in response[0].translations:
print(f"{translation.to}: {translation.text}")
# Output:
# vi: Xin chào, bạn khỏe không?
# ja: こんにちは、お元気ですか?
Translating Multiple Texts at Once (Batch)
texts = [
InputTextItem(text="Good morning"),
InputTextItem(text="Thank you very much"),
InputTextItem(text="See you later"),
]
response = client.translate(body=texts, to_language=["vi"])
for i, result in enumerate(response):
print(f"{texts[i].text} -> {result.translations[0].text}")
C# Example
using Azure;
using Azure.AI.Translation.Text;
var client = new TextTranslationClient(
new AzureKeyCredential("<your-key>"),
new Uri("https://api.cognitive.microsofttranslator.com")
);
var response = await client.TranslateAsync(
targetLanguages: new[] { "vi", "fr" },
content: new[] { "Azure Translator is amazing!" }
);
foreach (var item in response.Value)
foreach (var t in item.Translations)
Console.WriteLine($"{t.To}: {t.Text}");
Language Detection
response = client.find_sentence_length(
body=[InputTextItem(text="Bonjour tout le monde!")]
)
# Use detect endpoint for language detection
detect_response = client.detect(body=[InputTextItem(text="Bonjour tout le monde!")])
for result in detect_response:
print(f"Language: {result.language}, Confidence: {result.score:.2f}")
# Output: Language: fr, Confidence: 1.00
Transliteration
Convert text between scripts without changing the language:
# Convert Japanese Katakana to Latin
response = client.transliterate(
body=[InputTextItem(text="コンピューター")],
language="ja",
from_script="Jpan",
to_script="Latn"
)
print(response[0].text) # Output: konpyuutaa
Dictionary Lookup
response = client.lookup_dictionary_entries(
body=[InputTextItem(text="fly")],
from_language="en",
to_language="vi"
)
for entry in response[0].translations:
print(f"{entry.display_target} (confidence: {entry.confidence:.2f})")
Document Translation
Document Translation is an asynchronous batch operation that translates entire documents while preserving their original formatting (headers, tables, images).
from azure.ai.translation.document import DocumentTranslationClient
from azure.ai.translation.document.models import DocumentTranslationInput, TranslationTarget
client = DocumentTranslationClient(
endpoint="https://<your-resource>.cognitiveservices.azure.com/",
credential=AzureKeyCredential("<your-key>")
)
poller = client.begin_translation(
inputs=[
DocumentTranslationInput(
source_url="https://<storage>.blob.core.windows.net/source?<sas-token>",
targets=[
TranslationTarget(
target_url="https://<storage>.blob.core.windows.net/output-vi?<sas-token>",
language="vi"
)
]
)
]
)
result = poller.result()
for doc in result:
print(f"Document: {doc.source_document_url}")
print(f"Status: {doc.status}")
if doc.translated_document:
print(f"Translated to: {doc.translated_document.target_language}")
Custom Translator
Train a custom NMT model using your domain-specific parallel data (source–target sentence pairs) at Custom Translator Portal. Once trained, deploy the model and use it via a custom category ID:
response = client.translate(
body=[InputTextItem(text="The batch process failed with error code 0x80")],
to_language=["vi"],
category="<your-custom-category-id>" # Use your domain-specific model
)
Use Cases
- Customer support: Automatically translate incoming support tickets to the agent's language.
- E-commerce: Localize product descriptions and reviews.
- Healthcare: Translate medical documents for cross-border patient care.
- Education: Build multilingual learning platforms.
- Real-time chat: Add live translation to messaging apps.
- Document workflows: Translate contracts, reports, and manuals at scale.
Pricing
| Feature | Free (F0) | Standard (S1) |
|---|---|---|
| Text Translation | 2M chars/month | $10 per 1M characters |
| Document Translation | Not included | $15 per 1M source chars |
| Custom Translator | Not included | $40 per 1M source chars |
Best Practices
- Batch requests: Send multiple texts in a single API call (up to 100 items, 50,000 characters total per request).
- Cache translations: For static content, cache translated strings in your database to reduce API calls.
- Specify source language: Providing
from_languageimproves speed and avoids auto-detection overhead. - Use Custom Translator for domain-specific terminology to improve accuracy.
- Handle rate limits: Implement retry with exponential backoff for 429 responses.
Conclusion
Azure Translator is a powerful, versatile translation service that removes language barriers for global applications. With neural machine translation quality, document-level translation, custom model training, and a generous free tier, it is the ideal choice for building multilingual solutions at any scale.
For full documentation, visit Azure Translator Documentation.


