Two different problems
Wrong direction. The letters are right, but a “!” or an English word jumps to the wrong side. The app is treating the line as left-to-right. The tool adds invisible marks from the Unicode standard that say “this line is right-to-left, and this English part belongs together”.
Backwards letters. “םולש” instead of “שלום”. It happens in old PDFs, subtitles and graphics programs. The tool turns the line round and keeps numbers, English and links as they are.
“Work it out” decides by the final letters ם ן ץ ף ך: they belong at the end of a word.
Limits
- Some apps ignore the marks, or align the text left even when the order is right.
- Marks are real characters. Don't put them in passwords, code, file names or links.
- A turned-round line that wrapped in the original can come out with its lines in the wrong order.
- Arabic letters that were saved as separate shapes aren't joined again.
- It can tell backwards Hebrew by itself, not backwards Arabic: choose “Backwards letters”.
- Every line with Hebrew or Arabic becomes right-to-left, so it doesn't suit one foreign phrase inside an English sentence.
Better, when you can
Set the paragraph's direction in the app: Word, Google Docs and Pages have a button once a right-to-left language is on. Your text then needs no marks.