# Normalize Persian Text

Normalize Persian/Farsi text: replace Arabic letters, fix ZWNJ half-spaces, convert digits, and correct punctuation spacing in your browser.

## Run it

- **CLI:** `gizza tool persian-text-normalizer "متن فارسی را اینجا وارد کنید…"`
- **Web:** https://gizza.ai/tools/persian-text-normalizer/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/persian-text-normalizer/tool.json

## Inputs

- `text` — Persian text _(field)_
- `characters` — Replace Arabic characters with Persian (ك→ک, ي→ی, ى→ی, ة→ه) _(field)_
- `digits` — Digits _(field)_
- `half_space` — Fix half-spaces / ZWNJ (نیم‌فاصله) — attach می، ها، تر … _(field)_
- `punctuation_spacing` — Correct punctuation spacing (no space before ، . ؟، one after) _(field)_
- `persian_punctuation` — Convert Latin punctuation to Persian ( , → ، ; → ؛ ? → ؟ ) _(field)_
- `remove_diacritics` — Remove diacritics (harakat / تشکیل) and kashida (ـ) _(field)_
- `whitespace` — Clean whitespace (collapse spaces, trim) _(field)_

## Output

- Normalized text (text)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `text` — Persian text
- `characters` — Replace Arabic characters with Persian (ك→ک, ي→ی, ى→ی, ة→ه)
- `digits` — Digits
- `half_space` — Fix half-spaces / ZWNJ (نیم‌فاصله) — attach می، ها، تر …
- `punctuation_spacing` — Correct punctuation spacing (no space before ، . ؟، one after)
- `persian_punctuation` — Convert Latin punctuation to Persian ( , → ، ; → ؛ ? → ؟ )
- `remove_diacritics` — Remove diacritics (harakat / تشکیل) and kashida (ـ)
- `whitespace` — Clean whitespace (collapse spaces, trim)

Example: `https://gizza.ai/tools/persian-text-normalizer/?text=%D9%85%D8%AA%D9%86%20%D9%81%D8%A7%D8%B1%D8%B3%DB%8C%20%D8%B1%D8%A7%20%D8%A7%DB%8C%D9%86%D8%AC%D8%A7%20%D9%88%D8%A7%D8%B1%D8%AF%20%DA%A9%D9%86%DB%8C%D8%AF%E2%80%A6&characters=true&digits=persian&half_space=true&punctuation_spacing=true&persian_punctuation=true&remove_diacritics=true&whitespace=true`

---

## About this tool

This Persian/Farsi normalizer cleans text copied from mixed Arabic/Persian
sources. It can fold Arabic code points into Persian letters, convert digit
scripts, tidy نیم‌فاصله (ZWNJ) half-spaces, correct punctuation spacing, strip
harakat/diacritics, and collapse messy whitespace. Each pass is optional, so you
can run a full cleanup or isolate one rule while preserving the rest of the text.

Common fixes include:

- `ك` → `ک`, `ي` / `ى` → `ی`, and `ة` → `ه`.
- ASCII and Arabic-Indic digits → Persian digits, or the reverse to English.
- `مي روم` / `می روم` style prefixes and `کتاب ها` style suffixes → ZWNJ forms.
- No stray space before punctuation, and one readable space after punctuation.

### Worked example

Input:

```text
كتاب123 را مي خواهم ,خوب
```

With the default cleanup options, the output is:

```text
کتاب۱۲۳ را می‌خواهم, خوب
```

Turn on **Persian punctuation** if you also want Latin punctuation converted, for
example `,` to `،` and `?` to `؟`.

## FAQ

<details>
<summary>What is ZWNJ / نیم‌فاصله?</summary>

ZWNJ is the zero-width non-joiner character used as a Persian half-space. It keeps
letters visually separated without a full word space, as in `می‌روم` or `کتاب‌ها`.
The half-space option cleans spaces around existing ZWNJs and adds them for common
prefixes and suffixes.

</details>

<details>
<summary>Can I keep English digits?</summary>

Yes. Set **Digits** to **English digits** to convert Persian and Arabic-Indic
digits to `0-9`, or choose **Keep** to leave all digit scripts untouched. The
default is Persian digits because this tool is optimized for Persian publishing.

</details>

<details>
<summary>Does it change meaning or rewrite sentences?</summary>

No. It is a deterministic text normalizer, not a spell checker or rewriter. It
fixes Unicode variants, spacing, punctuation, digits, and optional diacritics;
it does not infer grammar, lemmatize words, or replace vocabulary.

</details>

<details>
<summary>Why is Persian punctuation off by default?</summary>

Changing `,`, `;`, and `?` to Persian `،`, `؛`, and `؟` is useful for final copy,
but it is more content-changing than spacing or Unicode folding. Enable it when
you want Persian punctuation marks; leave it off when preserving Latin punctuation
from source data matters.

</details>

## Related tools

- [Extract Action Items from Meeting Notes](https://gizza.ai/tools/action-item-extractor/): Extract action items, owners, and decisions from meeting notes or daily notes with deterministic rules. Markdown checklist or JSON, private in-browser.
- [Add Line Numbers](https://gizza.ai/tools/add-line-numbers/): Add line numbers to every line of text online, like nl or cat -n — custom start, step, separator, and alignment. Free and private, runs in your browser.
- [ANSI Log Renderer](https://gizza.ai/tools/ansi-log-renderer/): Paste ANSI-colored terminal output or CI logs and render them as HTML, or strip escape codes to plain text. Handles 16-color, 256-color, and truecolor SGR codes.
- [Censor Text](https://gizza.ai/tools/censor-text/): Redact a list of words (or common profanity) in any text by masking them — case-insensitive, whole-word or substring. Runs in your browser, nothing is uploaded, free.
- [Change Case](https://gizza.ai/tools/change-case/): Free online case converter — switch text between UPPERCASE, lowercase, Title Case, camelCase, PascalCase, snake_case, kebab-case and more, right in your browser.
