---
title: "Arabic prompt engineering - register, RTL and numerals"
description: "Write prompts that get good Arabic from an LLM: pick register and dialect, control numerals and dates, keep RTL formatting clean and handle Arabic–English mixing."
url: https://broadrouter.com/blog/arabic-prompt-engineering/
lang: en
updated: 2026-11-14
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# Arabic prompt engineering: register, RTL, numerals and mixed text

By the BroadNet Inference team · 5 min read · Published 2026-11-14 · Updated 2026-11-15

Good Arabic output comes from explicit instructions: name the register (MSA or a specific dialect), the audience, the numeral style (Western 0–9 or Eastern Arabic ٠–٩), the formatting allowed, and how to treat English terms. Render replies with dir="auto" or isolation marks so mixed Arabic and English displays in the right order.

## Key takeaways

-   "Reply in Arabic" is not a spec. Say MSA or which dialect, the audience and the tone.
-   Fix the numeral system and date format in the prompt; models mix them otherwise.
-   Most bidirectional display bugs are fixed in your UI, not the prompt: use dir="auto" or Unicode isolates.
-   Decide how to write English brand names, code and units, and give one example.
-   English or Arabic instructions both work; keep one language per system prompt and test both.

**On this page**

1.  How do you specify register and dialect?
2.  How do you control numerals, dates and currency?
3.  How do you fix right-to-left display problems?
4.  How should the model mix Arabic and English?
5.  Should the system prompt be in English or Arabic?
6.  How do you get structured output in Arabic?
7.  How do you test Arabic prompts?
8.  Arabic prompt checklist

To get good Arabic from an LLM, state every choice the model would otherwise guess: Modern Standard Arabic or a named dialect, the audience and tone, Western (123) or Eastern Arabic (١٢٣) digits, the date and currency format, how to write English terms, and whether to add diacritics. Then fix right-to-left display in your UI, not in the prompt.

## How do you specify register and dialect?

Arabic has a formal written standard, [Modern Standard Arabic](https://broadrouter.com/glossary/msa/) (MSA, الفصحى), and many spoken dialects. Business text is usually MSA; chat, marketing and voice products sometimes use dialect. Tell the model exactly which:

| Instead of | Say |
| --- | --- |
| Reply in Arabic. | Reply in clear, simple Modern Standard Arabic suitable for retail customers. |
| Use Gulf dialect. | Write in Saudi (Najdi-leaning) Gulf Arabic, informal but respectful, as a young brand would. |
| Be friendly. | Warm and polite. Use “حضرتك” for Egyptian customers; avoid slang. |

Some practical rules:

-   **“Simple MSA” is the safest default.** It is understood everywhere and sounds professional. Models write it more reliably than dialect.
-   **Name the country, not “Gulf” or “Levant”.** Saudi, Emirati and Kuwaiti speech differ; so do Lebanese and Jordanian.
-   **Address form.** Arabic marks gender in “you”. Pick a default (masculine singular is the common neutral form in UI text) or ask the model to use gender-neutral phrasing where possible, for example with the noun form “يرجى إدخال” (please enter) instead of the imperative “أدخل/أدخلي”.
-   **Diacritics.** Say “no diacritics” for normal text. Most models add few by default, but some add them to names or poetry-style replies.

For dialect input, see [how LLMs handle Gulf, Egyptian and Levantine Arabic](https://broadrouter.com/blog/arabic-llm-gulf-egyptian-dialects/).

## How do you control numerals, dates and currency?

Arabic text uses two digit sets: Western digits (0–9) and Eastern Arabic digits (٠١٢٣٤٥٦٧٨٩). Which set readers expect differs by country and by medium, and models will mix them unless told. Decide per product, based on what your existing materials in that market already use:

-   **Western digits** are easiest for parsing, search and data entry.
-   **Eastern Arabic digits** match a more traditional look. If you need them, convert at display time and keep Western digits in your data.

Also specify:

-   **Dates:** Gregorian, Hijri or both, and the format (for example 2026-11-14 or ١٤ نوفمبر ٢٠٢٦). Note that month names differ by region: نوفمبر in Egypt and the Gulf, تشرين الثاني in the Levant and Iraq.
-   **Currency:** symbol or code, and position. “ر.س” or “SAR”? Before or after the number? Give one example.
-   **Decimal separator:** ”.” or the Arabic decimal sign ”٫”.

A single worked example in the prompt fixes most of this: “Write prices like: 1,250.00 ر.س”.

## How do you fix right-to-left display problems?

Most “the Arabic is broken” bug reports are display problems, not model problems. When Arabic and Latin text or numbers share a line, the [Unicode bidirectional algorithm](https://www.unicode.org/reports/tr9/) decides the visual order based on the paragraph direction. If your chat bubble is left-to-right, a reply such as “تم شحن طلبك رقم 4821.” can show the full stop at the wrong end.

Fix it in the UI:

-   Set `dir="auto"` (or `dir="rtl"` for Arabic-only views) on the element that displays each message. See [MDN on the dir attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/dir) and the [W3C guidance on right-to-left markup](https://www.w3.org/International/questions/qa-html-dir).
-   When you insert values (names, order numbers, English product names) into Arabic templates, wrap them in `<bdi>` in HTML, or Unicode isolates (U+2068 FIRST STRONG ISOLATE … U+2069 POP DIRECTIONAL ISOLATE) in plain text.
-   In the prompt, ask for formatting your surface can show. WhatsApp and SMS: plain text, no Markdown tables. Web chat: Markdown is fine if your renderer handles RTL lists. Code blocks should stay left-to-right.

If you stream replies, set the direction on the container before the first token arrives, so text does not jump; see the [streaming guide](https://broadrouter.com/guides/streaming-chat-completions/).

## How should the model mix Arabic and English?

Real Arabic business text mixes languages: product names, technical terms, units, code. Decide the rule and say it:

-   “Keep brand and product names in their original Latin spelling.”
-   “Write technical terms in Arabic with the English term in parentheses the first time: واجهة برمجة التطبيقات (API).”
-   “Never transliterate English words into Arabic letters” or the opposite, if your audience prefers “الإيميل” over “البريد الإلكتروني”.
-   “If the user writes in English, reply in English. If they write in Arabizi, reply in Arabic script.” More on that in [handling Arabizi](https://broadrouter.com/blog/arabizi-llm-handling/).

## Should the system prompt be in English or Arabic?

Both work. English instructions with Arabic content are common and easy to maintain if your team does not all read Arabic. Arabic instructions can nudge tone and vocabulary in the right direction. Whichever you choose, keep one language per [system prompt](https://broadrouter.com/glossary/system-prompt/), and put an Arabic example of the desired output inside it either way. Arabic instructions can cost more tokens than the same rules in English; compare both in the free [Arabic token counter](https://broadrouter.com/tools/arabic-token-counter/). Our [tokenizer efficiency data](https://broadrouter.com/data/tokenizer-efficiency/) shows how many tokens the same Arabic and English sentences take across 16 tokenizers.

A complete example:

```python
import os
from openai import OpenAI

client = OpenAI(base_url="https://inference.broadnet.ai/v1", api_key=os.environ["BROADNET_API_KEY"])

SYSTEM = """You are the support assistant for an Egyptian electronics store.
Language: reply in simple Modern Standard Arabic. If the customer writes in English, reply in English.
Tone: warm, polite, concise. At most 3 sentences.
Numbers: Western digits. Prices like: 12,499 ج.م
Dates: Gregorian, like: 14 نوفمبر 2026
Names: keep brand and model names in Latin letters (iPhone 17, Galaxy S26).
Formatting: plain text only, no Markdown, no diacritics.
Example reply:
شكراً لتواصلك معنا. سعر Galaxy S26 حالياً 12,499 ج.م، والتوصيل متاح خلال يومين."""

r = client.chat.completions.create(
    model="broadnet/qwen3.8-27b",
    max_tokens=2000,  # reasoning comes first
    messages=[{"role": "system", "content": SYSTEM},
              {"role": "user", "content": "عايز أعرف سعر الايفون ١٧ وهل في تقسيط؟"}],
)
print(r.choices[0].message.content)
```

The customer writes in Egyptian Arabic (“I want to know the price of the iPhone 17, and is there instalment payment?”) using Eastern digits. The prompt makes the reply MSA with Western digits. The example reply in the prompt reads: “Thank you for contacting us. The Galaxy S26 currently costs 12,499 EGP, and delivery is available within two days.”

## How do you get structured output in Arabic?

When you need JSON, keep keys in English and values in Arabic. Say whether numbers should be numbers or strings, and which digit set to use inside strings. Ask for `null` instead of guesses. See [structured output with JSON schema](https://broadrouter.com/blog/structured-output-json-schema/).

## How do you test Arabic prompts?

Build a set of 30 to 50 real prompts per market, run them through each candidate model, and have a native speaker of that market grade register, correctness and naturalness. BroadNet reports that [Qwen3.8 27B](https://broadrouter.com/models/qwen3.8-27b/) wrote fluent Arabic and understood Gulf and Egyptian dialects in its tests; [DeepSeek V4.1 Flash](https://broadrouter.com/models/deepseek-v4.1-flash/) and [GLM 5.3](https://broadrouter.com/models/glm-5.3/) are on the same API, so switching is a one-line change. Compare their prices on the [pricing page](https://broadrouter.com/pricing/) or in the [DeepSeek V4.1 Flash vs Qwen3.8 27B comparison](https://broadrouter.com/compare/deepseek-v4.1-flash-vs-qwen3.8-27b/), and measure tokens on real Arabic text, since Arabic often takes more tokens per word than English. For the wider model-selection checklist, see [choosing an LLM API for Arabic](https://broadrouter.com/blog/choosing-an-llm-for-arabic/).

## Arabic prompt checklist

-   Register and country named.
-   Address form (gender) decided.
-   Digits, dates, currency and decimal separator specified with an example.
-   Formatting matched to the display surface.
-   English terms and brand names rule stated.
-   `dir="auto"` and isolation in the UI.
-   Native-speaker review on a fixed test set.

Free tools for this

-   [Arabic token counter](https://broadrouter.com/tools/arabic-token-counter/) Arabic vs English token counts per tokenizer: the "Arabic tax" in tokens and money.
-   [Arabic text normalizer](https://broadrouter.com/tools/arabic-text-normalizer/) Tashkeel, tatweel, alef, ya, ta marbuta, digits and invisible characters, with a matching Python function.
-   [Speech-to-text cost calculator](https://broadrouter.com/tools/speech-to-text-cost-calculator/) Hours, calls or voice notes to a monthly transcription bill, against your current provider.

[All free tools](https://broadrouter.com/tools/)

## Terms in this article

[Token](https://broadrouter.com/glossary/token/)

A token is the unit of text a language model reads and writes: a word, part of a word, a punctuation mark or a byte sequence produced by the model's tokenizer. LLM APIs count, limit and usually bill usage in tokens.

[Modern Standard Arabic (MSA)](https://broadrouter.com/glossary/msa/)

Modern Standard Arabic (MSA) is the standardized form of Arabic used in writing, news, education and formal speech across the Arab world. It is nobody's native everyday language: people speak regional dialects such as Egyptian or Gulf Arabic and switch to MSA in formal settings.

[Right-to-left (RTL) text](https://broadrouter.com/glossary/rtl-text/)

Right-to-left (RTL) text is writing, such as Arabic or Hebrew, displayed from right to left. Computers store it in logical reading order, and the Unicode Bidirectional Algorithm decides display order when RTL text mixes with left-to-right text, digits, model names or code.

[Arabic diacritics (tashkeel)](https://broadrouter.com/glossary/arabic-diacritics/)

Arabic diacritics, or tashkeel, are small marks written above or below letters to show short vowels, doubled consonants and the absence of a vowel. They are optional: most Arabic text, including news, omits them, so readers and software infer the vowels from context.

[Dialectal Arabic](https://broadrouter.com/glossary/dialectal-arabic/)

Dialectal Arabic is the everyday spoken Arabic of a region or city, such as Egyptian, Gulf, Levantine or Maghrebi Arabic. Dialects differ from Modern Standard Arabic in sounds, words and grammar, have no standard spelling, and are increasingly written online, which makes them harder for language models.

[Arabizi](https://broadrouter.com/glossary/arabizi/)

Arabizi is Arabic written informally in Latin letters, using digits for Arabic sounds with no Latin equivalent, such as 3 for ع. It is common in chat and social media, is mostly dialectal, has no standard spelling, and is often mixed with English or French.

[Structured output](https://broadrouter.com/glossary/structured-output/)

Structured output is an LLM API feature that constrains a model's reply to a format the developer specifies, usually a JSON Schema, so code can parse it reliably. It is stricter than JSON mode, which guarantees valid JSON but not a particular shape.

[System prompt](https://broadrouter.com/glossary/system-prompt/)

A system prompt is the instruction text an application sends to a language model ahead of the conversation, usually as a message with the system or developer role. It sets the model's role, rules, tone and output format, and the model is meant to follow it over conflicting user messages.

## Questions

### Should I write the system prompt in Arabic or English?

Both work on current models. English instructions are easier for most teams to maintain; Arabic instructions sometimes give a more natural tone. Keep each system prompt in one language and compare both on your own test set.

### Why does my Arabic text show punctuation in the wrong place?

That is a display problem, usually a container with left-to-right direction. Set dir="rtl" or dir="auto" on the element that shows the reply.

### How do I stop the model adding diacritics?

Say "Do not add diacritics (tashkeel)" in the prompt. Ask for them only where they help, such as learning materials or ambiguous names.

### How do I make an LLM use Eastern Arabic numerals?

Say it in the system prompt and show one example, such as "Write prices like: ١٬٢٥٠ ر.س". Models mix digit sets when the rule is missing. If you parse the output, ask for Western digits in JSON fields and convert for display instead.

### Which model writes the best Arabic?

Test on your own prompts. BroadNet reports fluent Arabic writing from Qwen3.8 27B in its tests, along with Gulf and Egyptian dialect understanding.

## Keep reading

-   [Gulf, Egyptian and Levantine Arabic: how LLMs handle dialects](https://broadrouter.com/blog/arabic-llm-gulf-egyptian-dialects/)
-   [Arabizi and LLMs: handling Franco-Arabic with numbers like 3 and 7](https://broadrouter.com/blog/arabizi-llm-handling/)
-   [Arabic–English translation with LLMs: prompts, glossaries, evaluation](https://broadrouter.com/blog/arabic-english-translation-llm/)
-   [JSON mode vs json\_schema: structured output that holds up](https://broadrouter.com/blog/structured-output-json-schema/)
-   [Add diacritics to Arabic text with an LLM: prompt, checks, DER](https://broadrouter.com/blog/arabic-diacritization-llm/)
-   [Translate app strings to Arabic with an LLM: placeholders and plurals](https://broadrouter.com/blog/translate-app-strings-to-arabic-llm/)
-   [Arabic grammar and spelling correction with an LLM: a how-to](https://broadrouter.com/blog/arabic-grammar-spelling-correction-llm/)
-   [Arabic meeting minutes from recordings: an API pipeline](https://broadrouter.com/blog/arabic-meeting-minutes-from-recordings/)
-   [Arabic named entity extraction with an LLM: JSON, dates and checks](https://broadrouter.com/blog/arabic-named-entity-extraction-llm/)
-   [Guide: Use the OpenAI Python SDK with BroadNet Inference](https://broadrouter.com/guides/openai-python-sdk/)
-   [Guide: Stream chat completions and handle dropped connections](https://broadrouter.com/guides/streaming-chat-completions/)

Try it on your real workload. New accounts start with $5 of credit for Gemma and transcription. DeepSeek, GLM and Qwen3.8 need a top-up.

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=blog-arabic-prompt-engineering&utm_content=page-cta) ·

**Sources**

-   [W3C, Structural markup and right-to-left text in HTML (fetched 2026-11-14)](https://www.w3.org/International/questions/qa-html-dir)
-   [MDN, the dir global attribute (fetched 2026-11-14)](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/dir)
-   [Unicode Standard Annex #9, Unicode Bidirectional Algorithm (fetched 2026-11-14)](https://www.unicode.org/reports/tr9/)
-   [BroadNet Inference pricing page, Qwen3.8 27B "Tested in Arabic" note (fetched 2026-11-14)](https://inference.broadnet.ai/pricing?utm_source=broadrouter&utm_medium=referral&utm_campaign=blog-arabic-prompt-engineering&utm_content=sources)
