Modes and direction

RTLY decides direction one block of text at a time, from the letters in it. This page explains the rule, the three modes and the things RTLY deliberately does not touch.

Checked against the source on 2026-10-08, RTLY 2.0.0.

The three modes#

ModeDirection and alignmentIranYekan fontUse it when
Full (default)YesYesYou want both.
FontNo changeYesThe site already handles direction, and you only want the font.
RTLYesNoYou like the site's own font and only want the direction fixed.

The mode is set per site, in the popup or on the settings page. A change applies to open tabs at once, without a reload. Switching a site off is separate: that stops RTLY on the site and reloads its tabs.

How direction is chosen#

For each block of text (a paragraph, a list item, a heading), RTLY counts letters:

  • Letters from right-to-left scripts count as right-to-left: Arabic (which includes Persian, Urdu and others), Hebrew, Syriac, Thaana, N'Ko, Samaritan, Mandaic and Adlam.
  • The English letters A to Z and a to z count as left-to-right.
  • Digits, punctuation, spaces, emoji and letters of other scripts (Cyrillic, Chinese and so on) are not counted at all.

If at least 30% of the counted letters are right-to-left, the block becomes right-to-left. The bar is 20% when the block contains a mark that only Arabic-script text uses: the Arabic comma, semicolon or question mark, a vowel mark, or the zero-width non-joiner used in Persian. Otherwise the block stays left-to-right. A block with no counted letters gets no direction.

The low bar is on purpose. Persian text is full of English terms such as React or npm, and it should still read right to left.

ExampleResultWhy
Run npm install را اجرا کنRight-to-left8 of the 21 counted letters (about 38%) are Persian.
Please translate the word سلام for meLeft-to-right4 of 31 counted letters (about 13%) are Persian.
A paragraph in EnglishLeft-to-rightNo right-to-left letters.
12345 + 678No changeNo letters are counted.

When a block is right-to-left, RTLY sets dir, direction and the alignment so the text sits on the right. Left-to-right blocks are set the same way to the left, which looks the same as the site's default. Persian lines inside an English-majority block are still ordered correctly, because each line works out its own base direction.

The font#

The IranYekan font is bundled in the extension. RTLY applies it only to elements whose text contains Arabic-script characters. If you delete the Persian text from such an element and type English, RTLY takes the font off again, so English text keeps the site's own font and its line height.

The message box#

The box where you type is not given a fixed direction. RTLY sets it to automatic and the browser follows the first strong letter of each line. Start a line in Persian and it is right-to-left. Start the next line in English and that line is left-to-right. In Font mode RTLY does not touch the direction of the box at all.

What RTLY leaves alone#

  • Code. Code blocks and inline code stay left-to-right and are not processed.
  • Sidebars, menus, headers and toolbars. RTLY recognizes them by their tags, roles and names. Conversation titles in the sidebar of Claude and Perplexity are the exception: a title that is mostly Persian is aligned to the right.
  • Icons and buttons that contain icons. Flipping them would swap the icon and its label.
  • Very long containers. A single element with more than 5000 characters of text gets the font but no direction. The paragraphs inside it are handled one by one.
  • The page layout. On sites where Persian text could flip the whole page, RTLY keeps the top-level layout left-to-right so the sidebar stays on its side.
  • Other frames. RTLY works in the top page only, not in embedded frames.

Copying text#

When you copy a selection that is mostly Persian from a right-to-left block, RTLY puts an invisible right-to-left mark in front of the text on your clipboard. This helps the text keep its direction where you paste it. Selections that are mostly English, and anything inside code, are copied as they are. For a Persian selection only plain text is copied, so formatting is not included.

Font size#

The font size setting scales the page's base font size by a percentage (85% to 120%). Text that the site sizes in relative units follows it. Text that the site sizes in fixed pixels does not.

Streaming answers#

While an answer is still being written, RTLY looks again after the page changes. A block can flip from left-to-right to right-to-left once enough Persian text has arrived.