.rtf
   HOME

TheInfoList



OR:

) As an example, the following RTF code would be rendered as follows:
This is some bold text.


Character encoding

A standard RTF file can only consist of 7-bit
ASCII ASCII ( ), an acronym for American Standard Code for Information Interchange, is a character encoding standard for representing a particular set of 95 (English language focused) printable character, printable and 33 control character, control c ...
characters, but can use
escape sequence In computer science, an escape sequence is a combination of characters that has a meaning other than the literal characters contained therein; it is marked by one or more preceding (and possibly terminating) characters. Examples * In C and ma ...
s to encode other characters. The two character escapes are
code page In computing, a code page is a character encoding and as such it is a specific association of a set of printable character (computing), characters and control characters with unique numbers. Typically each number represents the binary value in a s ...
escapes and, starting with RTF 1.5,
Unicode Unicode or ''The Unicode Standard'' or TUS is a character encoding standard maintained by the Unicode Consortium designed to support the use of text in all of the world's writing systems that can be digitized. Version 16.0 defines 154,998 Char ...
escapes. In a code page escape, two
hexadecimal Hexadecimal (also known as base-16 or simply hex) is a Numeral system#Positional systems in detail, positional numeral system that represents numbers using a radix (base) of sixteen. Unlike the decimal system representing numbers using ten symbo ...
digits following a backslash and
typewriter apostrophe The apostrophe (, ) is a punctuation mark, and sometimes a diacritical mark, in languages that use the Latin alphabet and some other alphabets. In English, the apostrophe is used for two basic purposes: * The marking of the omission of one o ...
denote a character taken from a Windows code page. For example, if the code page is set to
Windows-1256 Windows-1256 is a code page used under Microsoft Windows to write Arabic and other languages that use Arabic script, such as Persian and Urdu. This code page is ''neither'' compatible with ISO/IEC 8859-6 nor the MacArabic encoding. Windows-12 ...
, the sequence \'c8 will encode the Arabic letter ''bāʼ'' ب. It is also possible to specify a "Character Set" in the preamble of the RTF document and associate it to a header. For example, the preamble has the text \f3\fnil\fcharset128, then, in the body of the document, the text \f3\'bd\'f0 will represent the code point 0xbd 0xf0 from the Character Set 128 (which corresponds to the
Shift-JIS Shift JIS (also SJIS, MIME name Shift_JIS, known as PCK in Solaris contexts) is a character encoding for the Japanese language, originally developed by the Japanese company ASCII Corporation in conjunction with Microsoft and standardized as JIS ...
code page), which encodes "金". For a Unicode escape, the control word \u is used, followed by a 16-bit signed integer which corresponds to the Unicode UTF-16 code unit number. For the benefit of programs without Unicode support, this must be followed by the nearest representation of this character in the specified code page. For example, \u1576? would give the Arabic letter ''bāʼ'' ب, but indicates that older programs which do not support Unicode should render it as a question mark instead. The control word \uc0 can be used to indicate that subsequent Unicode escape sequences within the current group do not specify the substitution character. Until RTF specification version 1.5 release in 1997, RTF only handled 7-bit characters directly and 8-bit characters encoded as hexadecimal (using \'xx). Since RTF 1.5, however, RTF control words generally accept signed 16-bit numbers as arguments. Unicode values greater than 32767 must be expressed as negative numbers. If a Unicode character is outside BMP, it is encoded with a surrogate pair. Support for Unicode was made due to text handling changes in Microsoft Word – Microsoft Word 97 is a partially Unicode-enabled application and it handles text using the 16-bit Unicode character encoding scheme. Microsoft Word 2000 and later versions are Unicode-enabled applications that handle text using the 16-bit Unicode character encoding scheme. Because RTF files are usually 7-bit ASCII
plain text In computing, plain text is a loose term for data (e.g. file contents) that represent only characters of readable material but not its graphical representation nor other objects ( floating-point numbers, images, etc.). It may also include a lim ...
, they can be easily transmitted between PC-based operating systems. Converters that communicate with Microsoft Word for MS Windows or Macintosh generally expect data transfer as 8-bit characters and binary data which can contain any 8-bit values.


Human readability

RTF is a data format for saving and sharing documents, not a
markup language A markup language is a Encoding, text-encoding system which specifies the structure and formatting of a document and potentially the relationships among its parts. Markup can control the display of a document or enrich its content to facilitate au ...
; it is not intended for intuitive and easy typing. Nonetheless, unlike many word processing formats, RTF code can be
human-readable In computing, a human-readable medium or human-readable format is any encoding of data or information that can be naturally read by humans, resulting in human-readable data. It is often encoded as ASCII or Unicode text, rather than as binary da ...
. When an RTF file containing mostly Latin characters without
diacritic A diacritic (also diacritical mark, diacritical point, diacritical sign, or accent) is a glyph added to a letter or to a basic glyph. The term derives from the Ancient Greek (, "distinguishing"), from (, "to distinguish"). The word ''diacrit ...
s is viewed as a plain text file, the underlying ASCII text is readable, provided that the author has kept formatting concise. When RTF was released, most word processors used binary file formats; Microsoft Word, for example, used the .DOC file format. RTF was unique in its simple formatting control which allowed non-RTF aware programs like
Microsoft Notepad Windows Notepad is a simple text editor for Windows; it creates and edits plain text documents. It was first released in 1983 to commercialize the computer mouse in MS-DOS. History In May 1983, at the COMDEX computer expo in Atlanta, Microsof ...
to open and provide readable files. Today, most word processors have moved to XML-based file formats (Word has switched to the .docx file format). Regardless, these files contain large amounts of formatting code, so are often ten or more times larger than the corresponding plain text. To be standard-compliant RTF, non-ASCII characters must be escaped. Thus, even with concise formatting, text that uses certain dashes and quotation marks is less legible. Latin languages with many
diacritic A diacritic (also diacritical mark, diacritical point, diacritical sign, or accent) is a glyph added to a letter or to a basic glyph. The term derives from the Ancient Greek (, "distinguishing"), from (, "to distinguish"). The word ''diacrit ...
s are particularly difficult to read in RTF, as they result in substitutions like \'f1 for ñ and \'e9 for é. Non-Latin scripts are illegible in RTF — \u21563, for example, is used for . From the beginning, RTF has also supported Microsoft
OLE OLE, Ole or Olé may refer to: * Olé, a cheering expression used in Spain * Ole (name), a male given name, includes a list of people named Ole * Overhead lines equipment, used to transmit electrical energy to trams, trolleybuses or trains Co ...
embedded objects and Macintosh Edition Manager subscriber objects, which are not human-readable.


Common uses and interoperability

Most word processing software support either RTF format importing and exporting for some RTF specification or direct editing, which makes it a "common" format between otherwise incompatible word processing software and operating systems. Most applications that read RTF files silently ignore unknown RTF control words. These factors contribute to its
interoperability Interoperability is a characteristic of a product or system to work with other products or systems. While the term was initially defined for information technology or systems engineering services to allow for information exchange, a broader de ...
, though it is still dependent on the specific RTF version in use. There are several consciously designed or accidentally born RTF dialects. RTF is the internal markup language used by Microsoft Word. Since 1987, RTF files have been able to be transferred back and forth between many old and new computer systems (and now over the Internet), despite differences between operating systems and their versions. This makes it a useful format for basic formatted text documents such as instruction manuals, résumés, letters, and modest information documents. These documents, at minimum, support bold, italic and underline text formatting. Also typically supported are left-, center- and right-aligned text, font specification and document margins. Font and margin defaults, style presets and other functions vary according to program defaults. There may also be incompatibilities between different RTF versions, e.g. between RTF 1.0 1987 and later specifications, or between RTF 1.0–1.4 and RTF 1.5+ in use of Unicode characters. And though RTF supports metadata like title and author, not all implementations support this. Nevertheless, the RTF format is consistent enough to be considered highly portable and acceptable for
cross-platform Within computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in several Computing platform, computing platforms. Some ...
use.


Objects

Microsoft Object Linking and Embedding (OLE) objects and Macintosh Edition Manager subscriber objects allow embedding of other files inside the RTF, such as tables or charts from spreadsheet application. However, since these objects are not widely supported in programs for viewing or editing RTF files, they also limit RTF's interoperability. If software that understands a particular OLE object is not available, the object is displayed using a picture of the object which is embedded along with it.


Pictures

RTF supports inclusion of JPEG, PNG, Enhanced Metafile (EMF),
Windows Metafile Windows Metafile (WMF) is an image file format originally designed for Microsoft Windows in the 1990s. The original Windows Metafile format was not device-independent (though could be made more so with placement headers) and may contain both vector ...
(WMF), Apple PICT, Windows device-dependent bitmap, Windows device-independent bitmap and OS/2 Metafile picture types in hexadecimal (the default) or binary format in a RTF file. Not all of these picture types are supported in all RTF readers, however. When a RTF document is opened in software that does not support the picture type of an inserted picture, the picture is not displayed. RTF writers usually either convert an inserted picture in an unsupported picture type to one in a supported picture type, or do not include picture at all. For better compatibility with Microsoft products, some RTF writers include the same picture in two different picture types in one RTF file: one supported picture type to display, and one uncompressed WMF copy of the original picture to improve compatibility with some Microsoft applications like
Wordpad WordPad is a word processor software designed by Microsoft that was included in versions of Windows from Windows 95 through Windows 11, version 23H2. Similarly to its predecessor Microsoft Write, it served as a basic word processor, positione ...
. This method increases the RTF file size dramatically. The RTF specification does not require this method, and several implementations do not include the WMF copy (e.g. Abiword or Ted). For Microsoft Word, it is also possible to set a specific registry value ("ExportPictureWithMetafile=0") to prevent Word from saving the WMF copy.


Fonts

RTF supports embedding of fonts used in the document, but this feature is not widely supported in software implementations. RTF also supports generic font family names used for
font substitution Font substitution is the process of using one typeface in place of another when the intended typeface either is not available or does not contain glyphs for the required characters. Font substitution can be aided by: * classifying fonts into ...
: ''roman'' (
serif In typography, a serif () is a small line or stroke regularly attached to the end of a larger stroke in a letter or symbol within a particular font or family of fonts. A typeface or "font family" making use of serifs is called a serif typeface ( ...
), ''Swiss'' (
sans-serif In typography and lettering, a sans-serif, sans serif (), gothic, or simply sans letterform is one that does not have extending features called "serifs" at the end of strokes. Sans-serif typefaces tend to have less stroke width variation than ...
), ''modern'' (
monospace A monospaced font, also called a fixed-pitch, fixed-width, or non-proportional font, is a font whose letters and characters each occupy the same amount of horizontal space. This contrasts with variable-width fonts, where the letters and spaci ...
), ''script'', ''decorative'' and ''technical''. This feature is not widely supported either.


Annotations

Since RTF 1.0, the RTF specification has supported document annotations/comments. The RTF 1.7 specification defined some new features for annotations, including the date stamp (there was previously only "time stamp") and parents of annotations. When a RTF document with annotations is opened in an application that does not support RTF annotations, the annotations are not shown. Similarly, when a document with annotations is saved as RTF in an application that does not support RTF annotations, the annotations are not preserved in the RTF file. Some implementations, like Abiword (since version 2.8) and IBM Lotus Symphony (up to version 1.3), may hide annotations by default or require some user action to display them. The RTF specification also supports footnotes, which are widely supported in RTF implementations (e.g. in
OpenOffice.org OpenOffice.org (OOo), commonly known as OpenOffice, is a discontinued open-source office suite. Active successor projects include LibreOffice (the most actively developed) and Collabora Online, with Apache OpenOffice being considered mostly d ...
, Abiword,
KWord KWord is a deprecated word processor and a desktop publishing application, part of the KOffice suite. It has been obsoleted by Calligra Words of the Calligra Suite. History KWord was created by Reginald Stadlbauer as part of the KOffice proj ...
, Ted, but not in Wordpad). Endnotes are implemented as a variation on footnotes, so applications that support footnotes but not endnotes will render an endnote as a footnote. Microsoft products do not support comments within footers, footnotes or headers. Similarly, Microsoft products do not support footnotes in headers, footers, or comments. Inserting a comment or a footnote in one of these disallowed contexts may result in a corrupted document.


Drawing objects

The RTF 1.2 specification defined use of drawing objects, known as shapes, such as rectangles, ellipses, lines, arrows and polygons. The RTF 1.5 specification introduced many new control words for drawing objects. However, many RTF implementations, such as
Apache OpenOffice Apache OpenOffice (AOO) is an open-source software, open-source office suite, office productivity software suite. It is one of the successor projects of OpenOffice.org and the designated successor of IBM Lotus Symphony. It was a close cousin of ...
, do not support drawing objects (though they are supported in
LibreOffice LibreOffice () is a free and open-source office productivity software suite developed by The Document Foundation (TDF). It was created in 2010 as a fork of OpenOffice.org, itself a successor to StarOffice. The suite includes applications ...
4.0 on) or Abiword. Applications which do not support RTF drawing objects do not display or save the shapes. Some implementations will also not display any text inside drawing objects.


Security concerns

Unlike Microsoft Word's DOC format, as well as the newer
Office Open XML Office Open XML (also informally known as OOXML) is a zipped, XML-based file format developed by Microsoft for representing spreadsheets, charts, presentations and word processing documents. Ecma International standardized the initial version ...
and
OpenDocument The Open Document Format for Office Applications (ODF), also known as OpenDocument, standardized as ISO 26300, is an open file format for word processor, word processing documents, spreadsheets, Presentation program, presentations and ...
formats, RTF does not support macros. For this reason, RTF was often recommended over those formats when the spread of computer viruses through macros was a concern. However, having the .RTF extension does not guarantee a safe file, since Microsoft Word will open standard DOC files renamed with an RTF extension and run any contained macros as usual. Manual examination of a file in a plain text editor such as
Notepad A notebook (also known as a notepad, writing pad, drawing pad, or legal pad) is a book or stack of paper pages that are often Ruled paper, ruled and used for purposes such as note-taking, Diary, journaling or other writing, drawing, or scrapbooki ...
, or use of the file command in a
UNIX Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
-like systems, is required to determine whether or not a suspect file is really RTF. Enabling Word's "Confirm file format conversion on open" option can also assist by warning a document being opened is in a format that does not match the format implied by the file's extension, and giving the option to abort opening that file. One exploit attacking a vulnerability was patched in Microsoft Word in April 2015. Since 2014 there have been malware RTF files embedding
OpenXML Office Open XML (also informally known as OOXML) is a zipped, XML-based file format developed by Microsoft for representing spreadsheets, charts, presentations and word processing documents. Ecma International standardized the initial version a ...
exploits.


Implementations

Each RTF implementation usually implements only some versions or subsets of the RTF specification. Many of the available RTF converters cannot understand all new features in the latest RTF specifications. The
WordPad WordPad is a word processor software designed by Microsoft that was included in versions of Windows from Windows 95 through Windows 11, version 23H2. Similarly to its predecessor Microsoft Write, it served as a basic word processor, positione ...
editor in Microsoft Windows creates RTF files by default. It once defaulted to the Microsoft Word 6.0 file format, but write support for Word documents (.doc) was dropped in a security update. Read support was also dropped in Windows 7. WordPad does not support some RTF features, such as headers and footers. However, WordPad can read and save many RTF features that it cannot create, including tables, strikeout, superscript, subscript, "extra" colors, text background colors, numbered lists, right or left indent, quasi-hypertext and URL linking, and various line spacings. RTF is also the data format for "rich text controls" in MS Windows APIs. The default text editor for
macOS macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
,
TextEdit TextEdit is an open-source software, open-source word processor and text editor, first featured in NeXT's NeXTSTEP and OPENSTEP. It is now distributed with macOS since Apple Inc.'s acquisition of NeXT, and available as a GNUstep application fo ...
, can also view, edit and save RTF files as well as RTFD files, and uses the format as its default. As of July 2009, TextEdit has limited ability to edit RTF document margins. Much older Mac word processing application programs such as
MacWrite MacWrite is a discontinued WYSIWYG word processor released along with the first Apple Macintosh systems in 1984. Together with MacPaint, it was one of the two original "killer applications" that propelled the adoption and popularity of the GUI ...
and
WriteNow WriteNow is a word processor application for the original Apple Macintosh and later computers in the NeXT product line. The application is one of two word processors that were first developed with the goal that they be available at the time of ...
had the same RTF abilities as TextEdit has. The following free and open-source word processors attempt to work with Microsoft's RTF file format, see the criticism paragraph below. AbiWord,
Apache OpenOffice Apache OpenOffice (AOO) is an open-source software, open-source office suite, office productivity software suite. It is one of the successor projects of OpenOffice.org and the designated successor of IBM Lotus Symphony. It was a close cousin of ...
,
Bean A bean is the seed of some plants in the legume family (Fabaceae) used as a vegetable for human consumption or animal feed. The seeds are often preserved through drying (a ''pulse''), but fresh beans are also sold. Dried beans are traditi ...
,
Calligra Calligra Suite is a graphic art and office suite by KDE. It is available for desktop PCs, tablet computers, and smartphones. It contains applications for word processing, spreadsheets, presentation, databases, vector graphics, and digital painti ...
,
Collabora Online Collabora Online is an open source online office suite based on LibreOffice, enabling web-based collaborative real-time editing of word processing documents, spreadsheets, presentations, and vector graphics. Optional apps are available for deskto ...
and
LibreOffice LibreOffice () is a free and open-source office productivity software suite developed by The Document Foundation (TDF). It was created in 2010 as a fork of OpenOffice.org, itself a successor to StarOffice. The suite includes applications ...
.
Scrivener A scrivener (or scribe) was a person who, before the advent of compulsory education, could literacy, read and write or who wrote letters as well as court and legal documents. Scriveners were people who made their living by writing or copying w ...
uses individual RTF files for all the text files that make up a given "project".
SIL International SIL Global (formerly known as the Summer Institute of Linguistics International) is an evangelical Christian nonprofit organization whose main purpose is to study, develop and document languages, especially those that are lesser-known, to expan ...
's freeware application for developing and publishing dictionaries uses RTF as its most common form of document output. RTF files produced by Toolbox are designed to be used in
Microsoft Word Microsoft Word is a word processor program, word processing program developed by Microsoft. It was first released on October 25, 1983, under the name Multi-Tool Word for Xenix systems. Subsequent versions were later written for several other platf ...
, but can also be used by other RTF-aware word processors. RTF can be used on some ebook readers because of its interoperability, simplicity and low CPU processing requirements.


Libraries and converters

The open-source script rtf2xml can partially convert RTF to XML. GN
UnRTF
is an open-source program to convert RTF into HTML, LaTeX, troff macros and other formats
pyth
is a
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (prog ...
library to create and convert documents in RTF, XHTML and PDF format
Ruby RTF
is a project to create Rich Text content via
Ruby Ruby is a pinkish-red-to-blood-red-colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called sapph ...

RaTFink
is a library of Tcl routines, free software, to generate RTF output, and a Cost script to convert SGML to RTF
RTF::Writer
is a
Perl Perl is a high-level, general-purpose, interpreted, dynamic programming language. Though Perl is not officially an acronym, there are various backronyms in use, including "Practical Extraction and Reporting Language". Perl was developed ...
module for generating RTF documents
PHPRtfLite
is an API enabling developers to create RTF documents with
PHP PHP is a general-purpose scripting language geared towards web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementation is now produced by the PHP Group. ...
.
Pandoc Pandoc is a free-software document converter, widely used as a writing tool (especially by scholars)- - - and as a basis for publishing workflows. It was created by John MacFarlane, a philosophy professor at the University of California, Berk ...
is an open source document converter with multiple output formats, including RTF.
RTFGen
is a project to create RTF documents via pure
PHP PHP is a general-purpose scripting language geared towards web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementation is now produced by the PHP Group. ...

rtf.js
is a
JavaScript JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior. Web browsers have ...
based library to render RTF documents in HTML. The macOS command line tool textutil can convert files between rtf, rtfd, text, doc, docx, wordml, odt and webarchive formats. The editor Ted can also convert RTF files to HTML and PS format.


Criticism

The Rich Text Format was the standard file format for text-based documents in applications developed for Microsoft Windows. Microsoft did not initially make the RTF specification publicly available, making it difficult for competitors to develop document conversion features in their applications. Because Microsoft's developers had access to the specification, Microsoft's applications had better compatibility with the format. Also, each time Microsoft changed the RTF specification, Microsoft's own applications had a lead in time-to-market, because competitors had to redevelop their applications after studying the newer version of the format.
Novell Novell, Inc. () was an American software and services company headquartered in Provo, Utah, that existed from 1980 until 2014. Its most significant product was the multi-platform network operating system known as NetWare. Novell technolog ...
alleged that Microsoft's practices were anticompetitive in its 2004 antitrust complaint against Microsoft.


See also

*
Rich Text Format Directory Rich Text Format Directory, also known as RTFD (due to its extension ''.rtfd''), or Rich Text Format with Attachments, is a primary document format of TextEdit, an application native to NeXTSTEP and macOS which has also been ported to other ve ...
(''.rtfd'' file type) *
Enriched text Enriched text is a formatted text format for email, defined by the IETF in RFC 1896 and associated with the text/enriched MIME type which is defined in RFC 1563. Format It is "intended to facilitate the wider interoperation of simple enriche ...
format *
List of document markup languages The following is a list of document markup languages. You may also find the List of markup languages of interest. Well-known document markup languages * HyperText Markup Language (HTML) – an ad hoc markup language that was originally created f ...
*
Comparison of document markup languages The following tables compare general and technical information for a number of document markup languages. Please see the individual markup languages' articles for further information. General information Basic general information about the mark ...
*
Revisable-Form Text Document Content Architecture, or DCA for short, is a standard developed by IBM for text documents in the early 1980s. DCA was used on Mainframe computer, mainframe and IBM i systems and formed the basis of DisplayWrite's file format. DCA was late ...
(RFT), part of IBM's Document Content Architecture (DCA) * TNEF, Transport Neutral Encapsulation Format, the
Microsoft Outlook Microsoft Outlook is a personal information manager software system from Microsoft, available as a part of the Microsoft 365 software suites. Primarily popular as an email client for businesses, Outlook also includes functions such as Calendari ...
default message format


References


External links


RTF 1.9.1 specification
March 2008, from Microsoft
RTF 1.9.1 specification
March 2008, via earlier download from Microsoft and Internet Archive
RTF 1.8 specification
April 2004, from ysagnier.free.fr
RTF 1.6 specification
May 1999, from Microsoft

April 1997, from biblioscape.com
RTF 1.0, 1.2, 1.3, 1.5 and 1.7 specifications
from the RTF Tools open-source project
RTF 1.0 specification
June 1992, from the latex2rtf open-source project
''RTF Pocket Guide''
book homepage
RTF Character Set to Code Page
last edited June 2017 {{Authority control Computer file formats Technical communication Office document file formats Text file formats