Auto RTL for AI Chatbots (Arabic & Persian)

Automatically detects Arabic/Persian text in ChatGPT, Gemini, and Grok and applies Right-to-Left (RTL) formatting.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Author
AmirRezaTamandani
Daily installs
2
Total installs
8
Ratings
0 0 0
Version
1.1
Created
2026-07-08
Updated
2026-07-12
Size
2.34 KB
License
MIT
Applies to

Auto RTL for AI Chatbots: The Fix for Persian & Arabic Reading right-to-left languages like Persian (Farsi) and Arabic in default left-to-right (LTR) AI chat interfaces is a broken experience. Punctuation lands on the wrong side, sentence structure visually collapses, and reading long responses becomes a chore.

This script automatically detects RTL characters in AI responses and instantly corrects the text direction and alignment, restoring natural readability.

Features Zero-Click Activation: Runs automatically in the background. If the AI replies in Persian or Arabic, the text instantly aligns to the right and switches to dir="rtl".

Smart Detection: Uses Unicode ranges to target paragraphs containing Arabic/Persian scripts without affecting English text.

Code-Block Safe: Explicitly ignores

 and  blocks so your programming outputs remain strictly LTR and correctly formatted.

High-Performance: Uses a lightweight MutationObserver to flip text chunks instantly as they stream onto the page, avoiding layout thrashing or browser lag.

Supported Platforms ChatGPT (chatgpt.com)

Google Gemini (gemini.google.com)

Grok (x.com/i/grok)

Pro-Tip: Vazirmatn Font Integration Proper localization isn't just about direction; it's about typography. The script includes a commented-out line to apply the Vazirmatn font. If you value clean Persian web typography, simply open the script in Tampermonkey and uncomment this line:

JavaScript // el.style.fontFamily = 'Vazirmatn, Tahoma, Arial, sans-serif'; About the Author Built by Amir Reza Tamandani (TMAN) to enforce proper RTL layout rules and better localization for the frontend web community.