Persian/Arabic Kashida Remover

Remove decorative tatweel/kashida letter stretching from Arabic/Persian text

Strips the kashida (tatweel, U+0640 ـ) character used for decorative letter elongation in Arabic and Persian typography, cleaning text for storage, search, and reliable matching without changing meaning. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is a kashida?

A kashida, also called tatweel and encoded as U+0640 ـ, is a character that stretches the connecting line between Arabic or Persian letters. It is used to justify lines and for decorative effect, but it carries no phonetic or semantic value.

The kashida (tatweel) is a typographic character that stretches Arabic and Persian letters for justification or decoration. Because it carries no meaning, it should be stripped before text is stored, searched, or compared. This tool removes every kashida instantly.

How it works

The algorithm is a single, lossless pass: it deletes every occurrence of the tatweel character while leaving all other characters untouched.

target character:  ـ   (U+0640 ARABIC TATWEEL / kashida)
operation:         remove every occurrence
preserved:         letters, harakat, spaces, ZWNJ (U+200C), punctuation

Removing the tatweel does not break letter connections, because joining behaviour in Arabic script is driven by the surrounding letters, not by the kashida. The connecting shapes are recomputed automatically by the text renderer.

What the kashida is and why it exists

Arabic and Persian scripts are cursive by design — letters connect to each other within a word. The kashida character (U+0640, ARABIC TATWEEL) exploits this property: it can be inserted between two connected letters to extend the baseline stroke connecting them, making the word appear longer without changing any letter or sound. Traditional calligraphers used it to fill space on a line during manual typesetting. Modern digital typography and web text rendering use it for full-justification of Arabic and Persian paragraphs — the same purpose that inter-word spacing serves in Latin text.

Because a kashida is visual punctuation rather than phonetic content, two copies of the same word — one with kashidas inserted for decoration, one without — carry exactly the same meaning. A reader understands them identically. But a computer processing them byte by byte does not.

Why this matters for text processing

Search and de-duplication: a naïve string-match or hash-based de-duplication system treats الـسـلام and السلام as different strings, even though they are the same word. This means full-text search misses documents that use one form when the user typed the other, and de-duplication fails to merge identical content saved in different typographic styles.

Consistency in databases and indexes: user-submitted text arrives in wildly inconsistent forms. Some users (and some input methods) insert kashidas automatically for aesthetic reasons; others never do. Normalising by removing kashidas before storage ensures that all copies of the same token map to the same canonical form, making counts, lookups, and joins reliable.

Machine learning and NLP pipelines: training data and inference inputs need to be normalised consistently. Inconsistent kashida usage creates spurious vocabulary items — the model sees ک and کـ as different tokens — which wastes capacity and reduces accuracy on Arabic and Persian tasks.

What is preserved and what is removed

Only U+0640 is removed. The tool deliberately leaves untouched:

  • All Arabic and Persian letters in their base and extended forms
  • All harakat (short vowel diacritics: fatha, kasra, damma, sukun, shadda, tanwin forms)
  • The Zero-Width Non-Joiner (ZWNJ, U+200C), which is used in Persian to force a non-joining letter break and has genuine semantic value — for example separating the prefix می from a verb stem
  • All punctuation, numerals, and whitespace

Removing the ZWNJ would be an error: it changes the visual form of letters and in some cases changes meaning. This tool only targets the tatweel, which is always semantically inert.

Tips and example

الـــسـلام becomes السلام — identical in meaning, now consistent for matching. Run this step before indexing user-supplied Arabic or Persian text so that decoratively justified copies de-duplicate cleanly. Keep the original for display if the visual justification matters, and use the cleaned form only as the comparison key.

A practical pipeline for Arabic/Persian text normalisation typically applies kashida removal first, then other normalisation steps such as alef normalisation (standardising the various alef forms) and hamza normalisation. The kashida step should come first because it is purely additive content with no contextual effect on surrounding letters.