SARD: A Large-Scale Synthetic Arabic OCR Dataset for Book-Style Text Recognition Authors: Yasser Alhabashi, Omer Nacar, Serry Sibaee, Adel Ammar, Wadii Boulila Published: 2026 ABSTRACT AbstractArabic Optical Character Recognition (OCR) plays a critical role in converting extensive Arabic print media into digital formats. The development of modern OCR models, particularly advanced vision-language models, is hindered by the lack of large, diverse, and well-structured datasets that accurately replicate real-world book layouts. Most existing Arabic OCR datasets focus on isolated words or lines and are limited in scale, typographic diversity, or structural complexity representative of books. To address this limitation, this paper introduces SARD (Large-Scale Synthetic Arabic OCR Dataset). SARD is a synthetically generated dataset specifically designed to simulate book-style documents, comprising 2,621,075 document images and 794.6 million words rendered in six fonts: Sakkal Majalla, Arial, Calibri, Scheherazade New, Amiri, and Traditional Arabic. Unlike datasets derived from scanned documents, SARD is free from real-world noise and distortions, providing a clean and controlled environment for model training. Its synthetic nature enables exceptional scalability and precise control over layout and content variation. This study describes the dataset’s composition, generation process, and technical validation, and presents benchmark results for several traditional and deep-learning OCR models to highlight the challenges and opportunities associated with the dataset. SARD serves as a valuable resource for developing and evaluating robust OCR and vision-language models that can process diverse Arabic book-style texts.Subject terms: Computer science, Information technology Background & Summary The digitization of extensive collections of printed Arabic texts is essential for preserving historical documents, enhancing accessibility, and enabling new avenues for academic research1. Optical Character Recognition (OCR) serves as the foundational technology for converting image-based materials into machine-readable text, thereby facilitating search, analysis, and broader applications in Arabic natural language processing and machine learning2,3. Nevertheless, Arabic OCR faces unique challenges due to the script’s cursive structure, context-dependent letter shapes, and considerable variation across fonts and styles4. Achieving high-accuracy Arabic OCR, particularly for complex book layouts, requires advanced models trained on large, diverse datasets. Recent deep learning architectures, such as convolutional neural networks and vision-language models, have demonstrated significant potential for recognizing both printed and handwritten Arabic text5–8. However, their development is constrained by the scarcity of suitable training data. As summarized in Table 1, most existing Arabic OCR datasets focus on isolated words or lines (e.g., APTI9, PATS-A0110), handwritten text (e.g., MADBase11), or lack sufficient scale and typographic diversity. Datasets derived from scanned documents are often affected by noise and inconsistencies, while manual annotation remains prohibitively expensive. These limitations have resulted in a substantial data gap for training models on full-page, book-style documents. Table 1Comparison of SARD with existing Arabic OCR datasets.Dataset NameYearTypeNo. imagesTotal WordsFonts UsedFocusPATS-A01102009Printed22 K8,2488Classic Arabic Literature (Lines)MADBase112011Handwritten70 K700 K—Char-Based RecognitionAPTI92013Printed (Synthetic)45 M45 M10Single-word OCRUPTI202013Printed10 K12 K1 (Urdu)Urdu OCRAlexuW212014Handwritten25 K10,989—Segmented Letter-based RecognitionPAW222017Printed400 K550 K5Sub-word OCRYarmouk22018Printed9 K436,921—Diverse Printed Text (Pages)OnlineKHATT232018Handwritten (Online)10 K22,216MultipleHandwritten Arabic (Words/Lines)Shotor242020Printed (Synthetic)120 K62,900Various (Farsi)Farsi OCRADAB252021Handwritten15 K14.4 M—Tunisian Place Names (Words)IDPL-PFOD262021Printed (Synthetic)30 K38,47611 (Farsi)Synthetic Farsi OCR (Pages)Arabic-Nougat192023VLM + Markdonw13.7 K700 K—Markdown Conversion (Pages)SARD (Ours)2025Synthetic (Pages)2.6 M794.6 M6Large-scale Arabic book OCR Comparison of SARD with existing Arabic OCR datasets. To address this gap, SARD (Large-Scale Synthetic Arabic OCR Dataset) is introduced12. SARD is a large, synthetic dataset of Arabic document images designed to replicate printed book layouts. It comprises 2,621,075 document images and 794.6 million words rendered in six fonts: Sakkal Majalla, Arial, Calibri, Scheherazade New, Amiri, and Traditional Arabic. As detailed in Table 1, SARD distinguishes itself through its scale, emphasis on full-page book layouts, and typographic diversity. Its synthetic nature ensures a clean, perfectly aligned ground truth, establishing SARD as a valuable resource for training and evaluating OCR and vision-language models that can process complex Arabic text13,14. Methods The SARD dataset was created using a multi-step synthetic pipeline that converts a large Arabic text corpus into realistic book-style document images with perfectly aligned ground truth. The overall process is illustrated in Fig. 1. SARD Corpus Generation Pipeline. complex Arabic text. Source corpus acquisition SARD is constructed from a large collection of Arabic text sourced from the Alukah digital library (www.alukah.net). The source text was obtained from the public ImruQays/Alukah-Arabic dataset via the Hugging Face library. This collection comprises 133,105 unique online articles spanning topics such as Islamic studies, bibliography, news, culture, literature, social issues, fatawa and counsels, publications, and translations. Unlike book-based datasets, these articles lack standard bibliographic identifiers (e.g., ISBNs) and are instead linked to their original Alukah web pages. To maximize dataset diversity, all 133,105 articles were included without additional filtering. The content complies with Alukah’s terms of use, which permit non-commercial utilization. For transparency and reproducibility, each SARD record contains the exact text used for image generation and a link to the original article, enabling users to verify the provenance of each sample. By utilizing this large and diverse publicly available corpus, SARD exposes OCR models to a wide range of Arabic vocabulary, writing styles, and sentence structures. This diversity enhances the suitability of SARD for training and evaluating models intended for real-world Arabic document recognition. Text processing and formatting The pipeline begins with targeted text preparation to simulate realistic and consistent page layouts. No aggressive text cleaning or character normalization, such as diacritic removal or punctuation stripping, was applied to the source text. Instead, the text was used exactly as it appeared in the corpus to preserve natural spacing and authentic linguistic structure. To transform the continuous text into individual document pages, a sequential text-splitting algorithm was applied, utilizing the following structural rules: Dynamic text chunking The continuous text is programmatically split into page-sized chunks. First, each article was tokenized by whitespace, and words were accumulated iteratively into a temporary chunk. The maximum word count per chunk was dynamically adjusted based on the specific font being rendered to ensure realistic page layouts and to prevent text from spilling over onto a second page. As detailed in Table 2, the limits ranged from a maximum of 250 words for visually larger fonts, such as Scheherazade New, to 500 words for more compact fonts, such as Arial and Calibri1. Samples of the selected fonts are shown in Fig. 2.1 Table 2Comprehensive summary of SARD generation parameters, detailing layout, typography, and source text.Page Layout ParametersSpecificationValuePage SizeA4 (8.27 × 11.69 in)Left Margin0.9 inRight Margin0.9 inTop Margin1.0 inBottom Margin1.0 inGutter Margin0.2 inResolution300 DPIColor ModeGrayscalePage DirectionRight-to-LeftText AlignmentRightLine Spacing1.15Font SpecificationsFontWords/PageSizeSakkal Majalla50–30014 ptArial50–50012 ptCalibri50–50012 ptAmiri50–30012 ptScheherazade New50–25012 ptTraditional Arabic50–35014 ptSource Text DistributionCategoryNumber of ArticlesIslamic studies46,665Bibliography26,393News16,724Culture13,253Literature & Language11,581Social8,827Fatawa & Counsels8,096Publications & Comp.1,123Translations443Total Articles133,105 Comprehensive summary of SARD generation parameters, detailing layout, typography, and source text. Samples of the Arabic fonts included in SARD. Layout rendering Page layouts were standardized to common book-like settings using A4 page dimensions and a rendering resolution of 300 dots per inch (DPI), with all parameters summarized in Table 2. To introduce natural visual variation, both font size and the number of words per page were varied across fonts. The dynamically chunked text was first formatted into intermediate documents using the python-docx library, which was employed to enforce right-to-left (RTL) text direction and justified paragraph alignment. These documents were then converted to PDF format through LibreOffice operating in headless mode, and finally rendered into high-resolution grayscale images using the pdf2image and Pillow (PIL) libraries. Finally, for each generated image, the exact source text was saved in a corresponding plain-text file and directly paired with its Base64-encoded image data in the final CSV batches. The textual density of the generated pages is further characterized by reporting the average number of words and characters per image for each font, computed over the entire dataset, as shown in Table 3. These statistics complement the predefined page generation settings summarized in Table 2, which specify the word count ranges and font sizes used for each font during rendering. Fonts configured with identical layout parameters, such as Arial and Calibri (50–500 words at 12 pt), naturally exhibit similar textual densities, while fonts with comparable configurations, such as Sakkal Majalla and Traditional Arabic (14 pt), also produce closely related page statistics. Table 3Average word and character counts per generated image across selected fonts (mean ± standard deviation).FontWords/ImageCharacters/ImageScheherazade New231.17 ± 8.311378.56 ± 54.73Sakkal Majalla271.04 ± 12.651616.53 ± 78.62Calibri411.67 ± 36.282455.76 ± 212.25Arial411.67 ± 36.282455.76 ± 212.25Amiri271.04 ± 12.651616.53 ± 78.62Traditional Arabic301.38 ± 24.541802.16 ± 146.04 Average word and character counts per generated image across selected fonts (mean ± standard deviation). Fonts with smaller sizes and larger allowed word ranges, such as Arial and Calibri, generate denser pages with higher average word and character counts per image. In contrast, fonts with more visually expansive glyph structures or lower word limits, such as Scheherazade New (50–250 words), result in lower textual density. Similarly, Sakkal Majalla and Traditional Arabic use larger font sizes (14 pt), which reduces the amount of text that can fit within a page compared to the 12 pt fonts. These variations are important for OCR evaluation, as text density directly influences recognition difficulty, line segmentation complexity, and overall model performance. Font selection justification To ensure a realistic typographic representation, we conducted an empirical analysis of the fonts commonly used in Arabic publications. For books, we randomly sampled 100 entries from an online Arabic book repository2 for analysis, spanning the period 1970 to 2015. For academic journals, we utilized a large online index3 comprising more than 300 Arabic journals, from which 15 journals were randomly selected, spanning the period 2010 to 2025.2,3 The primary text font in each sampled document was manually identified and recorded. The observed distribution of fonts is summarized in Table 4. The results indicate that a small set of fonts dominates Arabic publishing, particularly Scheherazade and Traditional Arabic, followed by widely used system fonts such as Arial and Sakkal Majalla. Table 4Observed font distribution in sampled Arabic publications.FontCountPercentage (%)Scheherazade4236.5Traditional Arabic3127.0Arial1815.7Sakkal Majalla1210.4Other/Mixed1210.4 Observed font distribution in sampled Arabic publications. These findings confirm that the fonts selected in SARD reflect widely used styles in both book publishing and academic writing, thereby enhancing the dataset’s realism and practical relevance for OCR applications. Data Quality Validation To ensure the overall integrity of the SARD dataset, we implemented a comprehensive validation methodology covering linguistic quality, text-image alignment, image rendering metrics, and distribution analysis. Linguistic quality validation To assess the linguistic quality of the source texts, we conducted a structured manual evaluation on a randomly selected subset of 200 articles from the corpus. Each sample was independently annotated by two reviewers across five criteria: grammatical correctness, spelling accuracy, fluency, semantic accuracy, and overall quality. All dimensions were rated on a 5-point Likert scale (1 = poor, 5 = excellent), and final scores were computed as the mean of both annotators’ ratings. To assess annotation consistency, we report both Exact Agreement and Gwet’s AC1, which is more robust to prevalence and marginal distribution effects. As shown in Table 5, the inter-annotator agreement is consistently high across all evaluation dimensions, indicating reliable and stable quality judgments. Across all evaluation criteria, the dataset achieved a consistently high average score of 4.9/5. Minor differences between reviewers were observed but did not significantly affect the overall assessment. These results confirm that the dataset maintains a high level of linguistic quality, ensuring that downstream OCR performance is not influenced by underlying textual noise. Table 5Inter-annotator agreement and average quality scores across 200 manually evaluated samples.CriterionExact Agr.Gwet’s AC1Mean ScoreGrammar0.94970.94714.9Spelling0.95480.95274.9Fluency0.83920.80684.8Semantic Accuracy0.88440.87014.9Overall Quality0.83420.79654.9Average0.89250.87464.9 Inter-annotator agreement and average quality scores across 200 manually evaluated samples. Automated generation integrity checks During dataset generation, we implemented basic validation checks to ensure successful document conversion and image creation. The pipeline verified file existence after DOCX-to-PDF and PDF-to-image conversion stages, and samples that triggered processing exceptions were excluded from the final dataset. This ensured that only successfully processed image-text pairs were retained in the released SARD dataset. Sample-based text-image alignment verification Because accurate ground truth is critical for OCR training, we performed rigorous text-image alignment verification. Beyond our automated programmatic pairing, we conducted a manual quality control inspection on a random sample of 2,000 generated images for each font. This manual verification confirmed that the dynamically chunked source text perfectly matched the rendered image content without truncation, overflow across pages, or visible layout distortion. Consequently, SARD establishes a perfect one-to-one alignment between each image and its ground truth transcription, eliminating the transcription errors commonly found in manually annotated datasets. Image quality metrics As a fully synthetic dataset, image quality in SARD was explicitly controlled during generation rather than measured through post-hoc degradation analysis. Resolution verification was uniformly enforced at a fixed 300 DPI rendering parameter to simulate high-quality document scanning. Visual contrast was maximized and standardized by rendering pure black text on a pure white background, ensuring optimal foreground-background separation for model training. Furthermore, character legibility was enhanced via the digital font rendering engine’s anti-aliasing, which produced clean, smooth, and realistic print-quality character shapes across all generated batches. Arabic cursive rendering validation Given the complex, cursive nature of the Arabic script, in which character shapes change depending on their contextual position (isolated, initial, medial, or final), ensuring proper font rendering was a critical priority. Our generation pipeline utilized standard text-processing engines (python-docx and LibreOffice) that possess native, robust support for Complex Text Layout (CTL) and Right-to-Left (RTL) directional formatting. To empirically validate rendering accuracy, the manual inspection of the 2,000 sampled images per font specifically evaluated character connectivity and context-dependent shaping. We verified that all fonts accurately reproduced mandatory Arabic ligatures, maintained proper baseline alignment, and exhibited zero instances of common digital rendering failures, such as disconnected letters or missing glyphs. Furthermore, this human verification specifically targeted Bi-Directional (BiDi) edge cases—such as Arabic text interspersed with numbers, Latin characters, or special punctuation—to ensure the semantic reading order remained intact and was not reversed or jumbled during rendering. This confirms that the synthetic images structurally and visually mirror authentic printed Arabic text. Layout consistency verification To ensure that the predefined page parameters were consistently applied across the dataset, we integrated layout consistency checks into our validation phase. During the manual inspection of the sampled images, we specifically verified the geometric and structural properties of the rendered pages. We confirmed that all images strictly adhered to the A4 dimensional ratio and respected the defined margin boundaries (1.0-inch top/bottom, 0.9-inch left/right, and 0.2-inch gutter) without unintended text clipping, margin bleed, or document scaling issues during the PDF-to-image conversion. Furthermore, we visually validated that the python-docx engine successfully enforced proper Right-to-Left (RTL) text direction, justified paragraph alignment, and the specified 1.15 line spacing uniformly across all font types and text densities. Distribution analysis To validate the dataset’s diversity and real-world applicability, we analyzed both its domain and typographic distributions. As detailed in Table 2, the source text spans a wide array of domains, with a heavy emphasis on Islamic studies (46,665 articles), Bibliography (26,393 articles), and News (16,725 articles), which ensures a broad and complex vocabulary. Our empirical analysis of 115 real-world Arabic publications (Table 4) guided our font distribution strategy. SARD uses the following six fonts: Sakkal Majalla, Arial, Calibri, Scheherazade New, Amiri, and Traditional Arabic. Data Records SARD uses the following six fonts: Scheherazade New, Sakkal Majalla, Calibri, Arial, Amiri, and Traditional Arabic. The SARD dataset12 is publicly available on the Hugging Face Hub as a dataset collection, accessible at https://doi.org/10.57967/hf/8267. The dataset is published under the CC-BY-NC-ND 4.0 license, allowing for broad use in research and development. The collection is organized into separate datasets, or “splits,” where each one corresponds to one of the six fonts used in SARD: ScheherazadeNew, SakkalMajalla, Calibri, Arial, Amiri, and ArabicTraditional. In total, the collection contains 2,621,075 image-text pairs, totaling 1.54 TB of storage. Each record in a dataset provides image data along with its corresponding textual and metadata attributes. Each record in SARD contains a set of metadata fields designed to support both OCR training and source-level traceability. Specifically, the dataset includes the following fields: image_name, a unique identifier for each generated image; chunk, the ground-truth text content associated with the image; font_name, the font used during text rendering; image_base64, the Base64-encoded representation of the generated image; sample_id, a unique identifier for each image-text pair; and article_link, the link to the original source article from which the text was derived. The inclusion of sample_id and article_link improves dataset traceability and enables researchers to verify the provenance of the generated samples or conduct source-level analysis when needed. To support transparency and reproducibility, the software environment used for generating the dataset is also documented. The generation pipeline was executed using Python 3.11. Document creation, structural formatting, and right-to-left text handling were implemented using python-docx 1.2.0. The intermediate DOCX files were converted to PDF using LibreOffice 6.4.7.2 in headless mode, and the resulting PDFs were rendered to images using pdf2image 1.17.0. In addition to the main SARD dataset, we provide SARD-Extended, a variant designed to increase typographic diversity through a broader set of Arabic fonts rather than a larger number of samples. SARD-Extended includes 11 fonts: Sakkal Majalla, Arial, Calibri, Amiri, Scheherazade New, Noto Naskh Arabic UI, Lateef, Al-Jazeera Arabic, Thabit, Jozoor, and Traditional Arabic. These fonts cover a wider range of styles commonly found in Arabic documents, enabling evaluation under different character shapes, stroke patterns, and layout densities. Each font contains 5,000 source articles and produces 217,420 rendered document samples. As a result, SARD-Extended provides broader font coverage while containing fewer samples than the main SARD dataset. The dataset is publicly available at: https://huggingface.co/datasets/riotu-lab/SARD-Extended. Technical Validation To validate the utility and challenge of SARD as an OCR benchmark, we evaluated a diverse set of OCR models on a test subset of 2,000 images. Performance was assessed using Character Error Rate (CER), Word Error Rate (WER), BLEU, and ROUGE-L metrics across six Arabic fonts. The evaluated models include Tesseract15, EasyOCR16, AIN17, Mistral OCR18, arabic-large-nougat19, and two versions of Qari-OCR8. The complete evaluation results are detailed in the supplementary material (Table A.1), where they are also visually summarized via a radar chart in Figure A.1 and a heatmap in Figure A.2. The benchmark results reveal substantial performance differences across models and fonts. Among all evaluated systems, Mistral OCR consistently achieved the best overall performance, with the lowest average WER (0.0349) and CER (0.0226), and the highest BLEU (0.9507) and ROUGE-L (0.7634) scores. Qari-OCR v0.2.2.1 ranked second overall and showed competitive sequence-level performance, particularly in ROUGE-L, where it achieved the best score on the Calibri font (0.7815) and remained highly competitive across other fonts. In contrast, Qari-OCR v0.3 showed noticeable degradation across all metrics relative to v0.2.2.1, indicating reduced robustness to the dataset’s typographic diversity. Traditional OCR methods also demonstrated competitive behavior. Tesseract outperformed several deep learning-based approaches, including EasyOCR, AIN, and Arabic-Nougat, particularly in CER and BLEU metrics. For example, Tesseract achieved the second-best average CER (0.0447) and BLEU score (0.7835), highlighting that established OCR pipelines remain effective for structured Arabic text recognition. Conversely, AIN and EasyOCR exhibited substantially higher error rates and lower sequence similarity scores, suggesting limited generalization to highly varied Arabic typography. A key finding is the strong font-dependent variability observed across nearly all models. Fonts such as Amiri and Scheherazade generally yielded lower recognition errors, while Calibri and Arial produced more challenging conditions for several systems. Compact fonts with tighter spacing increase segmentation difficulty, whereas stylistically complex fonts introduce ligatures, contextual character variations, and irregular stroke patterns. These typographic characteristics directly affect token alignment and n-gram matching, leading to measurable fluctuations in BLEU and ROUGE-L scores. The results, therefore, demonstrate that SARD effectively captures the typographic complexity of real-world Arabic documents and provides a rigorous benchmark for evaluating OCR robustness across diverse writing styles. Usage Notes The SARD dataset is designed for seamless integration into modern machine learning workflows, particularly through the Hugging Face datasets library. It can be loaded directly in Python using the identifier riotu-lab/SARD. For efficient memory usage when working with large-scale data, it is recommended to enable streaming mode (i.e., streaming=True). Individual subsets of the dataset can be accessed by referencing their corresponding split names within the Hugging Face interface. This structure enables flexible experimentation, including training or evaluating models on specific font styles. A key implementation detail is that image data is stored in the image_base64 field as a Base64-encoded string. For visualization or model input, this string should be decoded and converted into a standard image format, such as with the Python Imaging Library (PIL). As a synthetic dataset, SARD provides a controlled environment suitable for pre-training and benchmarking OCR models. Its typographic diversity enables evaluation of model robustness and generalization across a range of Arabic font styles. The dataset’s standardized format and compatibility with the Hugging Face ecosystem facilitate efficient experimentation and reproducible research in Arabic document analysis. While SARD does not enforce predefined train, validation, and test splits, we recommend a standard split ratio of 80/10/10 for training, validation, and testing, respectively, as a practical starting point. However, we intentionally leave the choice of data partitioning to researchers to allow flexibility depending on the specific task, experimental setup, and evaluation protocol. Supplementary information Suplemmentary material Acknowledgements The authors acknowledge the support of Prince Sultan University for paying the Article Processing Charges (APC) of this publication. Author contributions Y.A.: Methodology, Validation, Model Training, Software Implementation, Writing – Original Draft. O.N.: Methodology, Validation, Visualization, Writing – Original Draft. S.S.: Conceptualization, Methodology, Validation. A.A.: Methodology, Review & Editing, Validation. W.B.: Methodology, Review & Editing, Project Administration. All authors have read and approved the final manuscript. Code availability The code used to generate the SARD dataset is publicly available on GitHub at https://github.com/riotu-lab/sard. The repository contains the complete generation pipeline to ensure transparency, promote reproducibility, and enable the community to extend this work. Competing interests The authors declare no competing interests. Footnotes These fonts were selected based on their widespread use in Arabic books and academic publications, as well as our practical experience, to reflect realistic typographic variation commonly encountered in OCR tasks, more details are in “Font Selection Justification”. (https://aljam3.com/) (https://www.dfaj.net/) Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Supplementary information The online version contains supplementary material available at https://doi.org/10.1038/s41597-026-07780-5. References Associated Data Supplementary Materials Suplemmentary material Data Availability Statement The code used to generate the SARD dataset is publicly available on GitHub at https://github.com/riotu-lab/sard. The repository contains the complete generation pipeline to ensure transparency, promote reproducibility, and enable the community to extend this work.