DEV Community

Cover image for I sent the same prompt in 27 languages. Czech costs 2x English. Chinese costs the same.
Johmisking
Johmisking

Posted on AI-assisted

I sent the same prompt in 27 languages. Czech costs 2x English. Chinese costs the same.

I'm a solo developer in Korea, and for a long time I assumed my Korean prompts were "about 2-3x more expensive" than English. Everyone says non-English text eats tokens. But I had never actually measured it.

So I did. I took one ordinary prompt, translated it into 27 languages, and ran every version through OpenAI's tokenizers. Some results matched what I expected. Several did not.

The setup

The prompt is a typical customer-support task, 34 tokens in English:

Please summarize the customer email below in three bullet points and suggest a polite reply. The customer says the order arrived two days late and one item was missing from the box.

Each translation was tokenized with two encodings using js-tiktoken:

  • o200k_base, the tokenizer OpenAI has used since GPT-4o
  • cl100k_base, the older GPT-4 / GPT-3.5 tokenizer, for comparison
import { getEncoding } from "js-tiktoken";

const enc = getEncoding("o200k_base");
const tokens = (text) => enc.encode(text).length;

tokens(english);   // 34
tokens(korean);    // 49
tokens(czech);     // 68
Enter fullscreen mode Exit fullscreen mode

The results

The language tax: extra tokens vs English, same prompt in 27 languages

Language Tokens (o200k) vs English Old GPT-4 tokenizer (cl100k)
English 34 1.00× 1.00×
Chinese (Simplified) 35 1.03× 1.53×
Indonesian 39 1.15× 1.38×
Spanish 40 1.18× 1.29×
Portuguese 41 1.21× 1.41×
Persian 42 1.24× 2.79×
German 43 1.26× 1.50×
Arabic 43 1.26× 3.03×
French 44 1.29× 1.44×
Dutch 44 1.29× 1.74×
Russian 45 1.32× 2.15×
Swedish 45 1.32× 1.50×
Chinese (Traditional) 46 1.35× 2.12×
Vietnamese 46 1.35× 2.32×
Italian 47 1.38× 1.59×
Korean 49 1.44× 2.50×
Turkish 50 1.47× 2.06×
Hindi 51 1.50× 4.59×
Filipino 52 1.53× 1.76×
Hebrew 53 1.56× 3.76×
Urdu 54 1.59× 4.24×
Bengali 57 1.68× 6.09×
Thai 59 1.74× 3.71×
Japanese 61 1.79× 2.21×
Ukrainian 64 1.88× 3.15×
Polish 64 1.88× 2.12×
Czech 68 2.00× 2.59×

What surprised me

1. The tokenizer upgrade was huge for Indic, Arabic and Thai scripts.
With the old GPT-4 tokenizer, Bengali needed 6.1x the tokens of English and Hindi 4.6x. With o200k they are down to 1.7x and 1.5x. Arabic went from 3.0x to 1.26x. If you last measured this in 2023, your numbers are badly out of date.

2. Simplified Chinese is basically free.
35 tokens vs 34 for English. Traditional Chinese, for the same sentence, costs 1.35x. Same language family, very different price, most likely because of how much of each was in the training data.

3. The new "expensive" languages use Latin and Cyrillic letters.
The top of the table is not Japanese or Thai. It's Czech (2.0x), Polish (1.88x) and Ukrainian (1.88x). Heavily inflected languages with diacritics split into many small pieces. Russian and Ukrainian share an alphabet, yet Russian costs 1.32x and Ukrainian 1.88x.

4. Korean is cheaper than I thought: 1.44x, not 2-3x.
The "2-3x" number I had in my head was true for the old tokenizer (2.5x). It's stale folk wisdom now.

What it means in money

Say you send this prompt 1 million times on a model priced at $2 per 1M input tokens:

Language Input tokens Input cost
English 34M $68
Korean 49M $98
Japanese 61M $122
Czech 68M $136

And that's only the input. If the model also answers in the same language, the output (usually 4-5x more expensive per token) carries the same multiplier.

Practical takeaways

  • Write system prompts and fixed instructions in English, and keep only the user's content in their language. The instructions are sent with every request; the multiplier compounds.
  • For internal steps (classification, extraction, tool calls), ask for output in English or JSON keys in English, and translate only what the end user sees.
  • Cache the long, fixed part of your prompt if your provider supports prompt caching; cached input is often 90%+ cheaper.
  • Measure your own text. One prompt is a small sample, and technical text, names and code behave differently.

Caveats

  • This is one prompt. A single sentence can swing a ratio by 0.1-0.2x. Treat the ranking as a rough map, not a precise price list.
  • Translations were machine-assisted and spot-checked. If you're a native speaker and a translation reads unnaturally, tell me and I'll re-run it.
  • Claude and Gemini use different tokenizers, which aren't available to run locally in the browser, so these numbers are only exact for OpenAI models.

The tool I built out of this

I turned this into a small free tool: TokenSave. You paste text and it shows:

  • exact GPT token counts (o200k runs in your browser; nothing is uploaded) and estimates for Claude and Gemini
  • a language overhead badge ("1.4x tokens vs English") calibrated with the numbers above
  • a cost planner: input tokens, expected output tokens and requests per month
  • a chat (JSON) mode that counts per-message formatting tokens

The UI is available in 27 languages, since the people who pay this tax are mostly not reading in English. There are also side calculators for AI video and image generation prices.

I'd love to hear:

  1. What ratio do you see for your language on real production prompts?
  2. Has anyone measured the same thing for Claude's or Gemini's tokenizer via their token-count APIs?


The 27 prompts I used (click to expand)
  • English: Please summarize the customer email below in three bullet points and suggest a polite reply. The customer says the order arrived two days late and one item was missing from the box.
  • Korean: 아래 고객 이메일을 세 가지 요점으로 요약하고 정중한 답장을 제안해 주세요. 고객은 주문이 이틀 늦게 도착했고 상자에서 물건 하나가 빠져 있었다고 말합니다.
  • Japanese: 以下の顧客メールを3つの箇条書きで要約し、丁寧な返信を提案してください。顧客によると、注文品が2日遅れて届き、箱から商品が1つ欠けていたそうです。
  • Chinese (Simplified): 请用三个要点总结下面的客户邮件,并建议一封礼貌的回复。客户说订单晚到了两天,而且箱子里少了一件商品。
  • Chinese (Traditional): 請用三個重點總結下面的客戶郵件,並建議一封禮貌的回覆。客戶說訂單晚到了兩天,而且箱子裡少了一件商品。
  • Spanish: Resume el siguiente correo del cliente en tres puntos y sugiere una respuesta amable. El cliente dice que el pedido llegó con dos días de retraso y que faltaba un artículo en la caja.
  • Portuguese: Resuma o e-mail do cliente abaixo em três tópicos e sugira uma resposta educada. O cliente diz que o pedido chegou com dois dias de atraso e que faltava um item na caixa.
  • French: Résumez l'e-mail du client ci-dessous en trois points et proposez une réponse polie. Le client indique que la commande est arrivée avec deux jours de retard et qu'un article manquait dans le colis.
  • German: Fasse die folgende Kunden-E-Mail in drei Stichpunkten zusammen und schlage eine höfliche Antwort vor. Der Kunde sagt, dass die Bestellung zwei Tage zu spät ankam und ein Artikel im Paket fehlte.
  • Italian: Riassumi l'email del cliente qui sotto in tre punti e suggerisci una risposta cortese. Il cliente dice che l'ordine è arrivato con due giorni di ritardo e che mancava un articolo nella scatola.
  • Russian: Кратко изложите письмо клиента ниже в трёх пунктах и предложите вежливый ответ. Клиент пишет, что заказ пришёл на два дня позже и в коробке не хватало одного товара.
  • Ukrainian: Коротко викладіть лист клієнта нижче у трьох пунктах і запропонуйте ввічливу відповідь. Клієнт пише, що замовлення прийшло на два дні пізніше і в коробці бракувало одного товару.
  • Turkish: Aşağıdaki müşteri e-postasını üç madde halinde özetleyin ve kibar bir yanıt önerin. Müşteri, siparişin iki gün geç geldiğini ve kutuda bir ürünün eksik olduğunu söylüyor.
  • Arabic: لخّص رسالة العميل أدناه في ثلاث نقاط واقترح ردًا مهذبًا. يقول العميل إن الطلب وصل متأخرًا يومين وإن أحد المنتجات كان مفقودًا من الصندوق.
  • Persian: ایمیل مشتری زیر را در سه نکته خلاصه کنید و یک پاسخ مودبانه پیشنهاد دهید. مشتری می‌گوید سفارش دو روز دیر رسید و یکی از اقلام در جعبه نبود.
  • Hindi: नीचे दिए गए ग्राहक ईमेल को तीन बिंदुओं में सारांशित करें और एक विनम्र उत्तर सुझाएँ। ग्राहक का कहना है कि ऑर्डर दो दिन देर से पहुँचा और डिब्बे में एक सामान कम था।
  • Bengali: নিচের গ্রাহকের ইমেলটি তিনটি পয়েন্টে সংক্ষেপ করুন এবং একটি বিনীত উত্তর প্রস্তাব করুন। গ্রাহক বলছেন অর্ডারটি দুই দিন দেরিতে এসেছে এবং বাক্স থেকে একটি জিনিস অনুপস্থিত ছিল।
  • Urdu: نیچے دی گئی گاہک کی ای میل کا تین نکات میں خلاصہ کریں اور ایک شائستہ جواب تجویز کریں۔ گاہک کا کہنا ہے کہ آرڈر دو دن دیر سے پہنچا اور ڈبے میں ایک چیز کم تھی۔
  • Indonesian: Ringkas email pelanggan di bawah ini dalam tiga poin dan sarankan balasan yang sopan. Pelanggan mengatakan pesanan tiba dua hari terlambat dan satu barang hilang dari kotak.
  • Vietnamese: Hãy tóm tắt email của khách hàng dưới đây thành ba ý chính và đề xuất một câu trả lời lịch sự. Khách hàng nói rằng đơn hàng đến trễ hai ngày và thiếu một món trong hộp.
  • Thai: โปรดสรุปอีเมลของลูกค้าด้านล่างเป็นสามข้อและเสนอคำตอบที่สุภาพ ลูกค้าบอกว่าคำสั่งซื้อมาถึงช้าไปสองวันและมีสินค้าหายไปหนึ่งชิ้นจากกล่อง
  • Polish: Podsumuj poniższy e-mail od klienta w trzech punktach i zaproponuj uprzejmą odpowiedź. Klient twierdzi, że zamówienie dotarło z dwudniowym opóźnieniem, a w paczce brakowało jednego produktu.
  • Dutch: Vat de onderstaande e-mail van de klant samen in drie punten en stel een beleefd antwoord voor. De klant zegt dat de bestelling twee dagen te laat aankwam en dat er één artikel in de doos ontbrak.
  • Filipino: Ibuod ang email ng customer sa ibaba sa tatlong punto at magmungkahi ng magalang na sagot. Sinabi ng customer na dumating ang order nang dalawang araw na huli at may isang item na kulang sa kahon.
  • Czech: Shrňte níže uvedený e-mail zákazníka do tří bodů a navrhněte zdvořilou odpověď. Zákazník píše, že objednávka dorazila se dvoudenním zpožděním a v krabici chyběla jedna položka.
  • Swedish: Sammanfatta kundens e-post nedan i tre punkter och föreslå ett artigt svar. Kunden säger att beställningen kom två dagar för sent och att en vara saknades i lådan.
  • Hebrew: סכמו את המייל של הלקוח למטה בשלוש נקודות והציעו תשובה מנומסת. הלקוח אומר שההזמנה הגיעה באיחור של יומיים ושפריט אחד היה חסר בקופסה.



Top comments (0)