---
title: Translate
description: Translate text between languages on-device
---

Translate text between languages with a model that runs in your browser, so the text never leaves your device.

## What it does

Translate splits the **Text** into pieces of about 1,000 characters at sentence ends, translates each piece with the model you pick, and joins the results.

* With *NLLB-200 distilled (translate)*, you choose the languages in **From** and **To**. It covers 200 languages.
* With a fixed-pair model whose name ends in `opus-mt-xx-yy` (added as a custom model), the model always translates its own pair and ignores **From** and **To**.

When **From** and **To** are the same, the text is returned unchanged without running the model. There is no cost per run and no API key.

## When to use it

* Translate incoming messages or scraped pages before you process them.
* Translate a reply before you send it.

To translate with a chat model and your own instructions, use [Basic LLM Chain](/nodes/builtin/ai/aiagents/basicllmchainnode/).

## Inputs and settings

**From** and **To** list 59 common languages by name. With an expression you can also pass an English language name (`Spanish`), a two-letter code (`es`) or any NLLB-200 code (`spa_Latn`), which reaches all 200 languages. For example, set **To** to `{{ $input.language }}`.

## Outputs

Each output item has these fields:

```json title="Shape of an output item"
{
  "text": "…",
  "from": "…",
  "to": "…"
}
```

`from` and `to` are the language codes actually used: NLLB codes such as `eng_Latn` and `fra_Latn`, or the model's own pair (such as `en` and `de`) for an opus-mt model.

## Dependencies and credentials

None. This node needs no connection and has no slots for other nodes.

The **Model** picker lists your installed translation models first, then ones that download on first use. *NLLB-200 distilled (translate)* is a large download (about 460 MB). To use an opus-mt model, add it on the [Local AI](/app/local-models/#add-a-custom-model) page.

## Example workflow

Translate the text you select into English:

1. [Context Menu](/nodes/builtin/trigger/contextmenu/) with **Menu Contexts** set to **Selection**.
2. Translate with **Text** `{{ $input.selectionText }}`, **From** **French**, **To** **English** and **Model** *NLLB-200 distilled (translate)*.
3. [Show Notification](/nodes/extension/shownotification/) with **Title** `Translation` and **Message** `{{ $input.text }}`.

## Common issues

* **"Choose a translation model."** **Model** is empty. Pick one.
* **"Provide some text to translate."** **Text** is empty after expressions run.
* **"Unknown source language "…"."** or **"Unknown target language "…"."** An expression in **From** or **To** returned something that is not a listed name, a two-letter code or an NLLB code.
* **The output is in the wrong language.** You picked an opus-mt model: it ignores **From** and **To**. Use NLLB-200 for other pairs.
* **The first run is slow.** The model downloads and loads on first use; later runs are fast.

## Related nodes

* [Summarize](/nodes/builtin/ai/localai/summarize/): condense text on-device.
* [Generate Text](/nodes/builtin/ai/localai/generate-text/): other text transforms on-device.
* [Transcribe Audio](/nodes/builtin/ai/localai/transcribe-audio/): turn speech into text to translate.
* [Basic LLM Chain](/nodes/builtin/ai/aiagents/basicllmchainnode/): translate with a chat model.