.RTF Rich Text Format
.rtf

Rich Text Format

RTF encodes formatted text using ASCII control words inside nested curly-brace groups, readable by virtually every word processor on every operating system. Microsoft introduced RTF in 1987 as a cross-platform interchange format, and the last spec update (RTF 1.9.1) shipped in 2008.

بنية الصيغة
Header version
Body content tree
Index references
Rich Textapplication/rtfMicrosoft 1987RTF 1.9.1Cross-PlatformText-Based Markup
بواسطة FileDex
غير قابل للتحويل

RTF rendering requires a full rich text layout engine with table and image support not available in browser WASM.

أسئلة شائعة

Can I open RTF files without Microsoft Word?

Yes. RTF opens in WordPad (built into every Windows install), TextEdit on macOS, LibreOffice Writer on all platforms, and Google Docs in a browser. RTF was designed specifically for cross-platform interchange, so no single vendor's tool is required.

Is RTF safer than DOCX for receiving documents from unknown senders?

RTF cannot execute VBA macros, which eliminates the most common DOCX-based attack vector. However, RTF has its own exploit history — crafted \objdata groups have triggered memory corruption in older Word versions (CVE-2017-11882). Strip OLE objects from untrusted RTF files before opening.

Why does my RTF file look different in Word vs LibreOffice?

RTF rendering depends on each application's control word interpretation. Later RTF features (drawing objects, nested tables, advanced list numbering) are Microsoft-specific extensions that LibreOffice may approximate differently. For pixel-perfect fidelity, convert to PDF.

Is RTF still actively developed?

No. The last specification update was RTF 1.9.1 in 2008. Microsoft now promotes DOCX (Office Open XML) as the standard word processing format. RTF remains widely supported for reading but receives no new features.

ما يميز .RTF

What is an RTF file?

RTF (Rich Text Format) is a document format developed by Microsoft in 1987 for cross-platform document exchange. Unlike plain text, RTF supports basic formatting (bold, italic, fonts, colors, tables) while remaining readable by most word processors across different operating systems.

اكتشف التفاصيل التقنية

How to open RTF files

  • WordPad (Windows) — Built-in
  • TextEdit (macOS) — Built-in
  • Microsoft Word (Windows, macOS) — Full support
  • LibreOffice Writer (Windows, macOS, Linux) — Free
  • Google Docs (Web) — Free, online

Technical specifications

Property Value
Format Tagged text (ASCII-based)
Formatting Bold, italic, fonts, colors, tables
Images Supported (embedded)
Encoding ASCII with escape sequences
Cross-platform Yes — Windows, macOS, Linux

Programs that open RTF files

  • WordPad — Built-in Windows editor
  • Microsoft Word — Full editing
  • LibreOffice Writer — Free alternative
  • TextEdit — macOS built-in
  • Google Docs — Online editing

Common use cases

  • Cross-platform documents: Share formatted text across OS
  • Email drafts: Formatted text without full document overhead
  • Legal documents: Simple formatted documents
  • Legacy compatibility: Interchange between word processors

المرجع التقني

نوع MIME
application/rtf
Magic Bytes
7B 5C 72 74 66 {\rtf text signature.
المطوّر
Microsoft
سنة التقديم
1987
معيار مفتوح
نعم
000000007B5C727466 {\rtf

{\rtf text signature.

البنية الثنائية

RTF is a text-based markup format, not a binary format, but it has a well-defined structure. Every RTF file starts with the opening brace and \rtf control word: {\rtf1 — the 1 indicates RTF version 1.x. The file is organized as nested groups delimited by curly braces { }. Each group contains control words (backslash-prefixed tokens like \b for bold, \i for italic, \par for paragraph break) and plain text content. The document header contains a font table (\fonttbl), color table (\colortbl), stylesheet (\stylesheet), and optional info group (\info with \author, \title, \creatim). After the header groups, body text follows with inline control words for character and paragraph formatting. Images are embedded as hex-encoded data inside \pict groups, specifying format (\pngblip, \jpegblip, \wmetafile) and dimensions. The file ends with a closing brace matching the opening {\rtf1. The magic bytes 7B 5C 72 74 66 correspond to the ASCII string {\rtf. RTF uses 7-bit ASCII as its base encoding, with Unicode characters expressed as \uN control words (e.g., \u8364 for the Euro sign) followed by an ANSI fallback character.

OffsetLengthFieldExampleDescription
0x00 1 byte Opening Brace 7B ({) Start of RTF document group. Every RTF file begins with this character.
0x01 4 bytes RTF Control Word 5C 72 74 66 (\rtf) Identifies the file as RTF. Followed by version number (always 1).
0x05 1 byte Version 31 (1) RTF version number. All spec revisions use version 1.
1987Microsoft releases RTF 1.0 alongside Word for Windows 1.0 as a cross-platform document interchange format1993RTF 1.3 adds Unicode character support via \uN control word1997RTF 1.5 shipped with Word 97 — adds drawing objects, OLE embedding, and table nesting2000RTF 1.7 released with Word 2000 — improved table and list support2006RTF 1.9 released with Word 2007 — last major feature update2008RTF 1.9.1 published — final specification revision. Microsoft shifts focus to OOXML (DOCX)2023Microsoft disables RTF content in Outlook by default as a security measure against RTF-based exploits
Convert RTF to PDF via LibreOffice أخرى
libreoffice --headless --convert-to pdf input.rtf

LibreOffice in headless mode renders the RTF document to PDF using its internal layout engine. No GUI is launched. Output is written to the current directory with the same base filename.

Convert RTF to HTML via unrtf أخرى
unrtf --html input.rtf > output.html

unrtf parses RTF control words and maps them to HTML tags. Bold becomes <b>, italic becomes <i>, and paragraph breaks become <p>. Images are extracted as inline data or separate files depending on the version.

Strip RTF formatting to plain text أخرى
unrtf --text input.rtf > output.txt

Outputs only the text content of the RTF file with all control words, images, and formatting stripped. Useful for indexing, search, or piping to text processing tools.

Batch convert RTF files to DOCX أخرى
libreoffice --headless --convert-to docx *.rtf

Converts all RTF files in the current directory to DOCX format using LibreOffice. Each output file retains the original base filename with a .docx extension.

RTF PDF render lossless PDF preserves exact page layout, fonts, and formatting for printing or archival. RTF has no concept of fixed page geometry — converting to PDF locks down the visual output across all viewers and printers.
RTF DOCX render near-lossless DOCX (Office Open XML) replaced RTF as the standard word processing format. Converting RTF to DOCX enables tracked changes, advanced table styles, and compatibility with modern collaboration tools like Microsoft 365 and Google Docs.
RTF HTML render lossy HTML conversion makes RTF document content accessible on the web. The unrtf tool maps RTF control words to semantic HTML tags, preserving bold, italic, lists, and table structure.
RTF TXT export lossy Stripping all RTF formatting produces a clean plain text file for use in scripts, log analysis, or systems that reject markup. All control words, images, and styling are discarded.
متوسط

نقاط الضعف

  • OLE object embedding — malicious OLE objects in \objdata groups can trigger memory corruption in vulnerable RTF parsers (CVE-2017-11882, CVE-2017-0199)
  • Font table overflow — crafted \fonttbl with excessive entries or malformed font names can cause heap overflow in parsers that pre-allocate based on table size
  • Equation Editor exploit — RTF \objdata embedding Microsoft Equation Editor 3.0 objects triggers stack buffer overflow in EQNEDT32.EXE (CVE-2017-11882)

الحماية: FileDex does not execute RTF parsing or OLE object instantiation. Any RTF processing occurs as text-level analysis in the browser sandbox with no COM/OLE component access. No file data leaves the device.

Open-source word processor with full RTF read/write support and headless CLI conversion
unrtf أداة
GNU tool to convert RTF to HTML, text, LaTeX, and other formats
Pandoc أداة
Universal document converter supporting RTF as input format
python-docx مكتبة
Python library for creating and modifying DOCX files (RTF conversion target)
RTF Pocket Guide مواصفات
O'Reilly reference covering RTF 1.7 control word syntax and group structure