Why Arabic text comes out of a PDF reversed, and how to fix it
You copied an Arabic paragraph out of a PDF and it arrived backwards, or it arrived with the letters standing apart instead of joined, or the amount inside the sentence came through scrambled. This is not your software and it is not your keyboard, and it is not one fault but three different ones that people all call reversed text, each with its own cause and its own fix. Drop your file into the tool below to see what actually comes out of it, then read the sections underneath to work out which case you have. All of the extraction runs inside your browser on your own device, so nothing is uploaded to a server, we never see what is in the file, and there is no account and no daily cap.

Drop your files here
Files are processed on your device and never uploaded
Runs in your browser. Your file never leaves your device.
You can process several files at once, up to 3.
Three different faults that people all call reversed
Before any fix, separate three complaints that arrive under the same word and do not share a cause. The first is that the whole line comes out backwards, so you read the last word first. That is an ordering fault. The second is that the words sit in the right places but the letters stand apart instead of joining, and you may see a lone alef at the start of a word or a lam and an alef that have come unstuck from each other. That is an encoding fault, not an ordering one. The third is that the Arabic itself is perfectly correct and then the amount or the account number inside the sentence arrives scrambled, so you read 00.1,250 where the page says 1,250.00. That third one is the dangerous one precisely because nothing about it looks wrong. The first is fixed by assembling the line right to left, the second by folding the letters back to their base forms or, if the file carries no character table at all, by recognition instead, and the third by treating the number as a left to right island inside a right to left line. Work out which one you have first, because the wrong fix makes the problem worse rather than better.
Cause one: the file stores the letters in visual order
A PDF is not a text document. It is a description of a drawn page: it says where each letter shape is painted, in which font and at what size, and it says nothing about how the sentence is read. When an Arabic program produces a file, it has already run the bidirectional algorithm before drawing, so the letters sit on the page in visual order, which is the order your eye sees them in from right to left. A reader that hands those letters back in the order it found them gives you a backwards line. It is being faithful to what it read and wrong about what you wanted, because what you want is logical order, the order in which a word is stored in ordinary text. This is why swapping one tool for another and trying again is not a strategy: tools differ in whether they run that pass back, not in how well they read. The tool on this page groups letters into lines by where they sit on the page, then assembles every line that contains a single Arabic character from right to left before handing it to you.
Cause two: the character table is missing or points at presentation forms
Every PDF carries a table that maps the font's shapes to Unicode characters, and copying and searching rest on that table alone. It has three possible states. It is correct and points at the base letters, which is the good case and the one that yields clean text. Or it points at the presentation forms, a Unicode range from U+FE70 to U+FEFF holding a separate picture of each letter for the start, middle and end of a word, added to the standard for compatibility with older systems rather than for writing. Then the text arrives with the letters standing apart or with duplicated shapes, and the fix is to fold each one back to its base letter, a step that runs here over every page's output before it reaches you. Or the table is not there at all, in which case the font paints the shapes and nothing says what they are, so what comes out is not repairable text but symbols that stand for nothing. That last state cannot be fixed by any tool that reads the text layer, and recognition is its only route, because recognition looks at the picture of the page rather than at its table.
The most common trap: reversing twice
What catches people out is rarely an inability to fix the problem. It is a fix applied where it does not belong. When a line comes out backwards the first thought is to reverse it, and if you reverse everything without checking you break what was already right: a file that stored its text in logical order to begin with, or one whose reader already ran the pass back for you, yields a correct line that your second reversal then flips. The result is a pipeline that works on half your files and corrupts the other half, and it usually surfaces only after hundreds of documents have gone through it and been built on. The rule is that detection comes before treatment: take a line whose text you know, compare it against what came out, and decide for that file whether it needs reordering, then treat the rest of its pages on that decision. Do not make reversal a fixed step that every file passes through. It is not a general improvement, it is the answer to one specific case.
A number inside an Arabic sentence: the fault that passes in silence
This fault was in this very tool and has been fixed, and it is worth describing because another tool may still have it today. An Arabic invoice line reading the total 1,250.00 riyals was coming out as the total 00.1,250 riyals. The cause is that the reader hands a line back in pieces and breaks a number at the decimal point, so 1,250 arrives, then the point, then 00, three pieces sitting side by side on the page. Ordering the entire line right to left merely because it contains Arabic flips those three pieces as well, and they are a left to right island inside a right to left line. The file is entirely innocent: its page carries the number correctly and in one piece. The correct rule is to split the line into maximal runs of Arabic and non Arabic, reverse the order of the runs, and reverse the contents of the Arabic runs only, so numbers, Latin words and references keep the order the page shows them in. What makes this fault dangerous is that it is invisible: a reversed sentence breaks its own meaning and gets corrected, while a reversed amount looks like a perfectly plausible amount and travels onward to wherever you sent it.
The word that comes back with two letters transposed
There is a second fault in the same family, and it is worth knowing because it reads as a spelling mistake rather than as a technical one. A contract reading this is an agreement between the first party was coming out with two words visibly scrambled inside themselves. The cause is that some shapes in the font stand for two characters at once, such as the lam with alef shape, and the mapping table expands that single shape into two characters in their correct logical order. If a reader collects the expansions of the shapes and then reverses the whole string to recover logical order, that is right for every shape standing for a single character and wrong for the pair that was already correct, so the pair comes back transposed inside the word. This cannot be repaired by searching and replacing in the extracted text, because the transposed pair is also an ordinary, legitimate Arabic sequence that occurs in real words, so replacing it corrupts good ones. The repair here reads the page's own shapes in the order the file stores them, rewrites nothing unless the evidence is unambiguous, and stops and leaves the rest alone the moment the alignment slips, because a repair that guesses is worse than no repair.
How to tell which case you have, in a minute
The test is short and it saves hours. Select a paragraph in the file, copy it, and paste it into a plain text editor, not into Word and not into anything that lays out the line for you, because a clever editor hides the answer from you when it redraws a backwards line in the right direction. Then look three times. Is the word order right? If you are reading the last word first, the file stores its text in visual order and your reader did not run the pass back. Are the letters joined? If they stand apart, or you see shapes you do not recognise, the problem is encoding and it needs the letters folded back to their base forms. Are the numbers and Latin words inside the sentence correct? If the Arabic of the line is right and only its number is scrambled, the fault is in how the Latin island was handled, not in the line. And there is a fourth possible answer: nothing highlights at all when you drag the cursor across the line, in which case there is no text layer in the file to begin with, and the next section is where you belong.
When there is no text in the file at all
A scanned file, and a photo of a page taken with a phone, are pictures rather than text, however clearly the words show on the screen. There is nothing in them to copy and no order to correct, so the question is neither reversal nor encoding but the complete absence of text. This tool refuses such a file with a message that names the reason and points you at recognition, rather than handing you an empty text file. That is a deliberate decision: an empty file suggested that the fault was in your document, which is the worst of the three possible behaviours, because you then believe you tried and failed when you were on the wrong road from the start. Recognition pulls the letters out of the picture of the page itself, so text exists where it did not before. And if your page is a photo from a phone camera, run it through the scan cleaning tool before reading it, because most complaints about Arabic recognition accuracy are really complaints about the state of the image rather than about the language.
What does not get fixed, and what to do with hundreds of files
Three things we do not promise to fix, said plainly. A file that carries no character table at all yields no usable text through any tool that reads the text layer, and recognition is its only route. A date typed as 2026-01-14 appears inside an Arabic paragraph as 14-01-2026 because that is genuinely what the page draws, so returning it that way is faithful rather than corrupt, and we leave it alone on purpose. And a page with a complicated design, an interlocking table or text in overlapping columns, may still need a short manual review however carefully the line is assembled. If you are working through hundreds of files to build a search or a question answering system, the right structure is a router rather than a pipeline: inspect each file on its own first, ask whether it has a usable text layer and in what order that layer comes out, then send it down the branch that suits it. Running a mixed corpus down one path is exactly what produces a pipeline that works half the time. Khallas is a tool and not a library, and we do not offer it as one, but it is the fastest way to classify a sample of your files and see what actually comes out of them before you write a single line of code.
Related pages
Three steps, that's it
Drop your PDF into the tray below, and set a page range if you only want certain pages
Press extract text, then paste the result into a plain text editor rather than one that lays the line out for you
Check the word order, the joining of the letters and every number against the original page before relying on the text
Frequently asked questions
Why does Arabic text appear reversed when I copy it from a PDF?
Because many Arabic files store the letters in visual order, as they are painted on the page, rather than in logical order. A reader that hands them back as it found them gives you a backwards line. The fix is to assemble every line containing Arabic from right to left before returning it, which is what the tool on this page does.
How do I fix reversed Arabic text after extracting it from a PDF?
Do not reverse it wholesale, because that corrupts the files that were already correct by flipping them a second time. Detect first: compare a line whose text you know against what came out, and decide for that file whether it needs reordering. Or extract the text here directly, where the ordering happens during the read rather than after it.
Why do Arabic letters appear separated after copying from a PDF?
Because the file's character table points at the presentation forms, a Unicode range holding a separate picture of each letter according to its position in the word, added for compatibility with older systems rather than for writing. The fix is to fold each one back to its base letter, a step that runs here over every page's output before it reaches you.
Why are the numbers and amounts reversed inside an Arabic sentence?
Because a number is a left to right island inside a right to left line, and the reader breaks it at the decimal point into separate pieces. Ordering the whole line without distinguishing them flips those pieces, so 1,250.00 comes out as 00.1,250. The danger is that a flipped amount still looks plausible, so check every amount against the original page.
What is the difference between visual order and logical order in a PDF?
Logical order is the order the letters are written and stored in as ordinary text. Visual order is the order they are painted on the page after the bidirectional algorithm has run. A PDF is a description of a drawn page, so many Arabic files carry the visual order, and anyone who wants text they can copy and search has to recover the logical order from it.
Why is the extracted text empty when I can see the words in the file?
Because the file is pictures rather than text, which is the case for scanned documents and photographed pages. There is nothing in it to copy and no order to correct. This tool refuses such a file and names the reason rather than handing you an empty result, and it points you at recognition, which reads the letters out of the image itself.
How do I extract text from an Arabic PDF correctly?
Drop the file into the tool at the top of this page and press extract text. Arabic lines are assembled right to left, the letters are folded back to their base forms, and numbers and Latin words inside a sentence keep their own order. All of it runs inside your browser, so the file is never uploaded and no account is needed.

