Unicode Left-to-Right Mark (LRM): Checking Left-to-Right Direction
What the Unicode Left-to-Right Mark (U+200E) changes, how to detect it, when it fixes mixed-direction text, and when plain text or markup is the better choice.
The Left-to-Right Mark, usually shortened to LRM, is an invisible Unicode character at code point U+200E. It shows up in mixed-direction text, such as English words or code inside Hebrew or Arabic sentences. It also turns up in copied strings that behave strangely in searches or comparisons. This review explains what the mark does and what it does not do. It also covers how to check for it and when it helps more than it harms.
Short answer: is the LRM suitable for your use?
Use an LRM when all three of these are true. Your text mixes left-to-right and right-to-left scripts. Punctuation, numbers or symbols appear on the wrong side when displayed. You can only work in plain text, with no markup or styling. In that situation, one invisible character can fix how a line displays without changing the visible wording.
The main tradeoff is that the mark is a real character, even though nobody can see it. It makes the string one code point longer. It can cause exact-match search, deduplication, password and username checks to fail. Anyone editing the text later will not know it is there. Keep text free of the mark if it serves as data, such as identifiers, keys, code, filenames, form values or anything compared by machine. In HTML or other styled documents, directional markup is generally preferred over invisible control characters.
What the Left-to-Right Mark actually changes
Several terms get mixed up here, so it helps to separate them. Reversing text means changing the stored order of characters or words. Mirroring means making glyphs look flipped. Unicode "font" generators replace letters with look-alike characters, such as mathematical alphanumerics. Bidirectional display is how software arranges stored text on screen when it contains both left-to-right and right-to-left scripts. The LRM belongs only to the last category. It does not reverse, mirror or restyle anything.
In storage, inserting an LRM adds exactly one code point, U+200E, at the chosen position. Every other character keeps its order and identity. Unicode classifies the mark as a format character (general category Cf) and as default-ignorable. That means software that does not support it should render nothing rather than a visible box.
On screen, the mark behaves like an invisible letter with strong left-to-right direction under the Unicode Bidirectional Algorithm (UAX #9). Neutral characters, such as spaces, most punctuation and many symbols, take their direction from the strong characters around them. Placing an LRM next to them changes what they "see" nearby, and therefore which side they display on. The mark does not turn a right-to-left paragraph into a left-to-right one. It also does not reorder Hebrew or Arabic letters within a word.
A worked example
Suppose a right-to-left paragraph ends with the programming language name C++. The letter C is strongly left-to-right. The two plus signs are neutral. Because the plus signs come last, they sit between the C and the end of a right-to-left paragraph. They therefore resolve to right-to-left and can appear on the left of the C, reading as ++C. Adding an LRM after the plus signs puts them between two left-to-right characters, so they display as C++.
Stored text without the mark: C + +
Code points: U+0043 U+002B U+002B
Stored text with the mark: C + + [LRM]
Code points: U+0043 U+002B U+002B U+200E
The visible characters are identical in both versions. Only the invisible fourth code point differs. That is why the change is easy to miss and hard to debug.
How to check whether text contains an LRM
You cannot confirm the mark by looking at rendered text, so inspect the code points or bytes. In UTF-8, U+200E is stored as the three bytes E2 80 8E. In HTML it can be written as the named entity or the numeric reference . Its right-to-left counterpart, the Right-to-Left Mark, is U+200F.
# Python: list every code point in a string
s = "C++\u200e"
print([f"U+{ord(c):04X}" for c in s])
# ['U+0043', 'U+002B', 'U+002B', 'U+200E']
# Shell: show the raw UTF-8 bytes
printf 'C++\xe2\x80\x8e' | od -An -tx1
# 43 2b 2b e2 80 8e
When auditing text for directional controls in general, search for the whole family, not just the LRM. The pattern below matches the implicit marks, the Arabic Letter Mark, and the embedding, override and isolate controls. Regex syntax for code point escapes varies by language, so adjust it for your tool.
[\u200E\u200F\u061C\u202A-\u202E\u2066-\u2069]
| Character | Code point | Role |
| Left-to-Right Mark (LRM) | U+200E | Invisible strong left-to-right character |
| Right-to-Left Mark (RLM) | U+200F | Invisible strong right-to-left character |
| Arabic Letter Mark (ALM) | U+061C | Invisible strong Arabic-letter character |
| LRE, RLE, PDF, LRO, RLO | U+202A–U+202E | Embeddings and overrides, ended by PDF |
| LRI, RLI, FSI, PDI | U+2066–U+2069 | Directional isolates, ended by PDI |
Of these, the three marks are the mildest. They act like a single invisible letter and open no scope that has to be closed. The override characters, especially U+202E, can make stored text display in a different order from how it reads. They were central to the source-code spoofing technique known as Trojan Source (CVE-2021-42574). An inspection workflow should flag overrides and isolates more strongly than isolated LRMs.
Will the text stay readable and usable after copying or sharing?
Because the LRM is an ordinary character in the text, plain-text copy and paste is designed to carry it along. Whether a given destination keeps it, strips it or normalizes it depends on that application. No destination-specific test results were supplied for this article. Treat survival in any particular chat app, editor, spreadsheet or social platform as something to verify in your own environment. One correct rendering does not prove the mark will behave the same elsewhere.
- Search and matching: a string containing an LRM is not byte-identical to the same visible text without it. Exact-match search, database lookups and duplicate detection may treat them as different, unless the system strips default-ignorable characters first.
- Length and limits: the mark counts toward character and byte limits. It adds one code point and three UTF-8 bytes.
- Editing: cursor movement and deletion near an invisible character can feel inconsistent. Editors may need one extra keystroke to step past it, and users may delete it without noticing.
- Identifiers and security: usernames, domain-like strings and code that contain invisible directional characters can be confusing or deceptive. Many systems restrict or reject them for that reason.
- Reading order: the mark changes only where neutral characters display. It does not change the logical order stored in the text, which is what most software reads.
Accessibility: because assistive technology generally works from the stored logical order, an LRM should not change the sequence in which words are read. Whether a particular screen reader announces, ignores or pauses on the mark was not documented or tested in the supplied evidence. That remains an open gap. Do not assume consistent behavior across screen readers or versions.
When markup or plain text is the better choice
In web pages and other formats that support structure, directional markup is generally recommended over invisible control characters. Examples include the dir attribute, the bdi element, and the CSS properties direction and unicode-bidi with the isolate value. Markup is visible in the source, survives editing more predictably, and can be applied to a whole span rather than relying on one invisible character in the right spot. The LRM remains useful where no markup layer exists, such as plain-text messages, text fields and some exported data.
Keep a plain version without the mark when the text will be reused as data, compared by machine, pasted into code, or searched exactly. If an LRM was added only to fix how a line displays, consider storing the clean string and applying direction control at display time. That keeps the stored content clean while still fixing what readers see.
Evidence gaps
This review relies on the published Unicode character properties and the Bidirectional Algorithm. No product-specific measurements, destination tests or assistive-technology results were available. Before relying on the mark in a specific workflow, test it in the actual apps and screen readers involved. The open questions are whether copy and paste keeps it, whether search treats it as invisible, and how it is announced.