Free, open-source tool

Arabic PII Redactor

Paste Arabic text and redact Saudi, Emirati, Egyptian, Kuwaiti and Bahraini IDs, IBANs, phone numbers, plates, e-mails and URLs. Runs in your browser.

By Bayanat Labs· Updated · اقرأ بالعربية

The Arabic PII Redactor by Bayanat Labs finds personal data in Arabic and Arabic-English text and replaces it. Paste text, see what was found, choose how to replace it (a typed placeholder, a mask or a generated value of the same format) and copy the result. It finds Saudi, Emirati, Egyptian, Kuwaiti and Bahraini identity numbers, IBANs of 21 Arab states, phone numbers of the 22 Arab League states, Saudi and UAE vehicle plates, e-mail addresses and URLs, in Western, Arabic-Indic and Persian digits.

Open the redactor · Code on GitHub · Evaluation set on Hugging Face

The redactor runs in your browser: your text is not uploaded, stored or logged. It runs a JavaScript port of the rule-based recognisers of the Python package arabic-pii-pack, which returns the same spans with the same scores as the package on 1,300 evaluation sentences and 3,000 random test texts. Person names are found by the Python package with its optional name model, not in the browser. Detection is a technical aid: review the output before you rely on it.

What it finds

Entity type Where How it is checked Context word needed
SA_NATIONAL_ID Saudi Arabia 10 digits starting with 1, Luhn check digit No
SA_IQAMA Saudi Arabia resident ID: 10 digits starting with 2, Luhn check digit No
AE_EMIRATES_ID UAE 784-YYYY-NNNNNNN-C, year field, Luhn check digit No
EG_NATIONAL_ID Egypt 14 digits: century, real birth date, governorate code (no check-digit rule has been published, so the last digit is not verified) No with a known governorate code, yes otherwise
KW_CIVIL_ID Kuwait 12 digits with a valid birth month and day (structure only) Yes
BH_CPR Bahrain 9 digits (length only) Yes
IBAN_CODE 21 Arab states (other countries through Presidio's IBAN recogniser) registry length, BBAN structure, MOD 97-10 No
PHONE_NUMBER 22 Arab League states libphonenumber number plans (via phonenumbers) Only for numbers written without a country code or trunk prefix
SA_VEHICLE_PLATE Saudi Arabia three plate letters (Arabic, written apart, or Latin) and 1-4 digits Yes
AE_VEHICLE_PLATE UAE emirate name, plate code and 1-5 digits Yes
EMAIL_ADDRESS any Presidio's e-mail recogniser No
URL any Presidio's URL recogniser (without trailing punctuation) No
PERSON any optional Arabic name model (Python package, [ner] extra), Arabic script only No

A valid result means "well formed": nothing is looked up, and a match does not mean that a number was issued or belongs to anyone. Weak formats count only next to a context word, and the Arabic context words also match with clitics attached: وجوالي and بالهوية count as جوال and هوية.

How well it works

Scored on a synthetic evaluation set written for this release: 1,000 test sentences with 1,383 gold spans, in Modern Standard Arabic, Gulf and Egyptian phrasing and Arabic-English text. Generated examples; not real personal data; any match to a real person is coincidental. Exact span match at the default threshold of 0.5, with the optional name model:

Entity type Gold spans Precision Recall F1
SA_NATIONAL_ID 95 1.000 1.000 1.000
SA_IQAMA 81 1.000 1.000 1.000
AE_EMIRATES_ID 35 1.000 1.000 1.000
EG_NATIONAL_ID 72 1.000 1.000 1.000
KW_CIVIL_ID 36 1.000 1.000 1.000
BH_CPR 31 1.000 0.968 0.984
IBAN_CODE 149 1.000 1.000 1.000
PHONE_NUMBER 330 0.997 0.994 0.995
SA_VEHICLE_PLATE 28 1.000 1.000 1.000
AE_VEHICLE_PLATE 22 1.000 1.000 1.000
EMAIL_ADDRESS 88 1.000 1.000 1.000
URL 38 1.000 1.000 1.000
PERSON 378 0.937 0.820 0.874
All 1,383 0.984 0.949 0.966
  • The format-checked recognisers score F1 0.984 to 1.000. The same team wrote the data and the rules, so this shows that the formats are covered in all three digit scripts; it is not an estimate of accuracy on real documents.
  • Person names: F1 0.874 with exact spans and 0.928 with overlapping spans. Names written in Latin letters are not detected.
  • None of the 200 test sentences without personal data (order numbers, amounts, dates, flight and tracking numbers) received a flag.
  • On 5,000 Arabic Wikipedia paragraphs, the identity-number, IBAN, phone and plate recognisers flagged 0 spans at the default threshold and 11 at a threshold of 0.3, which is why weak matches need a context word.

Use it in code

pip install "git+https://github.com/Bayanat-Labs/arabic-pii-pack@v0.1.0"

echo "جوالي 0501234567" | bl-arabic-pii redact
bl-arabic-pii redact --in notes.txt --operator mask
bl-arabic-pii redact --in records.jsonl --field text --operator fake --out redacted.jsonl
bl-arabic-pii entities

The PyPI package has not been released yet. Until it is, install from GitHub at the release tag, as above; pip install bayanatlabs-arabic-pii will work once it is published. Python 3.10 or later. Person names need the [ner] extra, which runs CAMeL Lab's CAMeLBERT MSA NER model (Apache-2.0), downloaded on first use.

>>> from bl_arabic_pii import redact
>>> text = "هويتي ١٠٠٠٠٠٠٠٠٨ وجوالي +966 50 123 4567"
>>> redact(text).text
'هويتي [SA_NATIONAL_ID] وجوالي [PHONE_NUMBER]'
>>> redact(text, operator="mask").text
'هويتي ********** وجوالي +*** ** *** ****'

Generated examples; not real personal data; any match to a real person is coincidental.

Cite as

@software{bayanatlabs_arabic_pii_pack_2026,
  author  = {{Bayanat Labs}},
  title   = {arabic-pii-pack: Arabic and Gulf personal-data recognisers and redaction for Microsoft Presidio},
  version = {0.1.0},
  year    = {2026},
  url     = {https://github.com/Bayanat-Labs/arabic-pii-pack},
  license = {Apache-2.0}
}

The release record, with licences and changelog, is the Arabic PII Pack on Bayanat Labs Open.

Licence and contact

Code and the in-browser redactor: Apache-2.0. Evaluation set, results and documentation: CC BY 4.0. Built on Microsoft Presidio (MIT) and phonenumbers (Apache-2.0). Questions and corrections: hello@bayanatlabs.com.

Need production-grade, rights-cleared Arabic document data?

The redactor is free. For licensed Arabic document datasets, see Bayanat Documents.