How to clean many Arabic text files at once
If you have a folder of .txt files, such as book chapters, interview transcripts or text exported from an old system, there is no need to open each one and paste it into the editor. Choose up to 20 files and one cleanup preset; the tool cleans them all the same way and gives you a ZIP with the results and a report on every file.
The files are read inside your browser and never uploaded, and your originals are not modified. You get new copies whose names end in -clean.txt. The examples show one file's text with each preset.
How to use it
- Choose a preset under Cleaning options: Common diacritics only, Tidy spacing or Western digits, protected links. For any other combination, set it up first in the editor via Adjust cleaner settings, come back and choose Current cleaner settings.
- Read the Options line under the menu. It lists the transformations that will actually run, or tells you the text will be kept as decoded.
- Click Choose .txt files (up to 20) and select your files. They appear in a list marked Ready to process.
- Click Clean files. Each file switches to Ready with its output name, or shows why it was rejected.
- Review the list, then click Download results ZIP. If you change the preset after cleaning, click Clean files again, because the old results are discarded.
- To start over, click Clear batch.
Worked examples from the tool
الدَّرْسُ الأَوَّلُ كَتَبَ الطَّالِبُ الوَاجِبَ فِي الدَّفْتَرِ.
الدرس الأول كتب الطالب الواجب في الدفتر.
Settings: Cleaning options: Common diacritics only, the same as Remove common Arabic diacritics in the Cleaner
الفصل الأول كان يا مكان في قديم الزمان النهاية
الفصل الأول كان يا مكان في قديم الزمان النهاية
Settings: Cleaning options: Tidy spacing, the same as Trim spaces at line edges plus Collapse spaces and tabs
رقم الطلب ٤٥٢٧ بتاريخ ٢٠٢٦/١٠/٢٣ تتبع الطلب: https://example.com/track/١٢٣
رقم الطلب 4527 بتاريخ 2026/10/23 تتبع الطلب: https://example.com/track/١٢٣
Settings: Cleaning options: Western digits, protected links
What is in the ZIP
arabicfix-cleaned-files.zip holds one cleaned file for each file that succeeded, named after the original with -clean.txt on the end. If two names would collide, a number is added, as in notes-clean-2.txt. Next to them is arabicfix-batch-report.json, a report listing the options used, the status of every file, its size in text units before and after cleaning, and the reason any file was rejected. Keep it as a record of the settings used.
One bad file does not stop the batch. Its reason appears in the list, and the remaining files are still processed.
Why a file gets rejected
- Only .txt files are accepted. The tool does not read Word or PDF files. Save the text from them as a plain text file first.
- Invalid file: only UTF-8 is accepted. A file saved in a legacy Arabic encoding such as Windows-1256, or in UTF-16, is rejected rather than turned into unreadable symbols. Re-save it as UTF-8 in your text editor and try again. The same message appears if a file is over 400,000 bytes or 100,000 text units.
- Combined output exceeds one million units. The batch has reached its limit; clean the remaining files in a second batch.
- Choose 1–20 files with a combined size no greater than 4,000,000 bytes. This one applies to the whole batch: select fewer files or split them into two batches.
Pick the preset carefully
The preset applies to every file without exception, so try it on one file in the Cleaner first and compare. Common diacritics only strips harakat from everything, including texts that may need them, such as poetry or religious texts; the guide to removing Arabic diacritics covers when that is safe. Tidy spacing trims line edges and collapses repeated spaces, but it does not delete blank lines, as the second example shows. If you need that, tick Remove blank lines in the editor and use Current cleaner settings. For a full cleanup plan, see the Arabic cleanup guide.
Limits
- Up to 20 files per batch with a combined size of 4,000,000 bytes. Each file can be up to 400,000 bytes and 100,000 text units, and total output is capped at one million units.
- UTF-8 .txt files only. Text is not extracted from PDF or Word, and broken encoding is not repaired.
- Results are saved with LF line endings, so the CRLF endings common on Windows are converted.
- One preset per batch. You cannot apply different options to different files in the same run.
- Current cleaner settings come from the editor in the same session; reloading the page resets them to the defaults.
Frequently asked questions
Are my files uploaded to the internet?
No. Your browser reads the files from your device, cleans them locally and builds the ZIP on your device as well.
Are the original files changed?
No. They stay where they are, untouched. You get new cleaned copies inside the ZIP.
What does 100,000 text units mean for an Arabic file?
Each Arabic letter, space or vowel mark counts as one unit, and an emoji usually counts as two or more, so a file can hold roughly 100,000 characters. That many Arabic letters takes about 200 KB, because each Arabic letter uses two bytes in UTF-8.
My file opens fine on my computer. Why does it say Invalid file?
It is most likely saved in an encoding other than UTF-8. Many editors display older encodings correctly, but this tool accepts UTF-8 only. Re-save the file as UTF-8 and select it again.
Can I use options other than the three presets?
Yes. Set whatever you need in the editor, including letter normalisation or duplicate-line removal, then choose Current cleaner settings without reloading the page.
