Arabic text toolkit
Prepare Arabic text for a search index or a training set: strip what carries no meaning, unify spellings a model would otherwise learn twice, and find the invisible characters that corrupt a dataset without showing on screen.
Sign in to save this toolPaste the Arabic text to clean, or open a text file.
Invisible characters found
- U+200F right-to-left mark · 1×
What to apply
Tick each change you want. The result updates as you type.
More options: numbers, punctuation, whitespace (5 on)
Result
182 characters · ≈ 57 tokens · 37% fewer tokens than before
7 operations changed the text:
- Remove invisible characters (−1 characters)
- Remove tatweel (ـــ) (−5 characters)
- Remove diacritics (tashkeel) (−19 characters)
- Unify alef: أ إ آ ٱ to ا (replaced in place)
- Unify ya: ى to ي (replaced in place)
- Arabic-Indic digits ٠١٢ to 012 (replaced in place)
- Drop duplicate lines (−63 characters)
Token counts are an estimate (about ±20%).
How to use it
- Paste your Arabic text or open a text file. A sample with typical problems is loaded to start with.
- Pick a preset (search index, training set, display cleanup) or tick the operations you want one by one.
- Check the result and the list of operations that actually changed something, with the characters each one removed.
- Copy the cleaned text or download it as a .txt file.
Supported formats and limits
- Text up to 2,000,000 characters; files up to 5 MB of UTF-8 text (.txt, .md, .csv, .tsv, .json, .jsonl).
- Operations are character-level rules: they do not understand grammar, so unifying ta marbuta or hamza can produce misspelled words. Use those for search, not for text people will read.
- Diacritic removal covers the standard harakat, superscript alef and Qur’anic annotation marks (U+064B–U+065F, U+0670, U+06D6–U+06ED).
- Token counts are an estimate (about ±20%), not a specific model’s tokenizer.
Examples
- Stripping tashkeel and tatweel from copied articles before building a search index.
- Normalising alef and ya and dropping duplicate lines in an Arabic fine-tuning dataset.
- Finding a hidden right-to-left mark that breaks exact-match comparisons.
- Converting ١٢٣ to 123 so numbers sort and compare consistently.
Frequently asked questions
Why normalise Arabic text before indexing or training?
أ, إ, آ and ا are one letter to a reader and four different tokens to a model. A corpus that keeps all four spends capacity on spelling variance, and a search index that keeps them fails to match the same word typed differently.
Should I always remove diacritics?
No. Removing tashkeel cuts the token count and suits ordinary prose, but it is wrong for Qur’anic text, poetry and teaching material, where the marks carry meaning and pronunciation. That is why it is a separate switch.
What are the invisible characters?
Direction marks, zero-width joiners and non-joiners, the byte-order mark and similar format characters. They survive a copy-paste from PDFs and chat apps. This tool lists them by name and count, can show them as codes, and can remove them.
Is my text sent anywhere?
No. Everything runs in your browser; the text never leaves the tab.