The Rich Text Format (often abbreviated RTF) is a legacy proprietary document file format with published specification developed by Microsoft Corporation from 1987 until 2008 for cross-platform document interchange with Microsoft products. Prior to 2008, Microsoft published updated specifications for RTF with major revisions of Microsoft Word and Office versions.

It is the default format of WordPad and TextEdit but both of those allow saving to ODF since 2009. Full office suites never used it as a default. Since Windows 11 removed WordPad in an update, it is no longer able to open them without additional software.

Most word processors are able to read and write some versions of RTF. There are several different revisions of RTF specification; portability of files will depend on what version of RTF is being used.

RTF should not be confused with enriched text or its predecessor Rich Text, or with IBM's RFT-DCA (Revisable Format Text-Document Content Architecture), as these are different specifications.

RTF is not a markup language. It is not considered human-readable and was never meant to be edited in a text editor.

Most RTF files only contain plain text in ASCII encoding because non-ASCII letters are represented by escape sequences and binary data is encoded in Base16. The specification mentions \binN to insert binary data directly but except for possibly some historical exceptions all implementations write binary data in Base16 and the \binN embedding feature has mainly been abused by malicious software. In the context of RTF binary data refers to images, fonts and OLE objects.

History Richard Brodie, Charles Simonyi, and David Luebbert, members of the Microsoft Word development team, developed the original RTF in the middle to late 1980s. The first RTF reader and writer shipped in 1987 as part of Microsoft Word 3.0 for Macintosh, which implemented the RTF version 1.0 specification. All subsequent releases of Microsoft Word for Macintosh, as well as all Windows versions, can read and write in RTF format.

Microsoft maintains RTF. The final version was 1.9.1 in 2008, which implemented features of Office 2007. Microsoft has discontinued enhancements to the RTF specification, so features new to Word 2010 or a later version will not save properly to RTF. Microsoft anticipates no further updates to RTF, but has stated willingness to consider editorial and other non-substantive modifications of the RTF Specification during an associated ISO/IEC 29500 balloting period.

RTF files were used to produce Windows Help files, though these have since been superseded by Microsoft Compiled HTML Help files.

From the beginning, RTF has supported Microsoft OLE embedded objects and Macintosh Edition Manager subscriber objects.

+RTF specifications for Microsoft Word RTF version Publication date Microsoft Word version MS Word release date Notes 1.0 1987 Microsoft Word 3 1987 The latest revision came in June 1992. The 1992 revision defined support for Microsoft Object Linking and Embedding (OLE) objects and Macintosh Edition Manager subscriber objects. It also supported inclusion of the Windows Metafile, PICT, Windows device-dependent bitmap, Windows device-independent bitmap and OS/2 Metafile image types in RTF. 1.1 Microsoft Word 4 1989 Allowed for font embedding, which lets font data to be located inside the file. 1.2 1993 Microsoft Word 5 1991 1.3 January 1994 Microsoft Word 6 1993 1/94 GC0165; for device-independence and interoperability, encouraged embedding bitmaps within Windows Metafiles, instead of using Windows device-independent bitmaps or Windows device-dependent bitmaps. 1.4 September 1995 Microsoft Word 95/Word 7 1995 1.5 April 1997 Microsoft Word 97/Word 8 1997 Introduced Unicode RTF, which supports 16-bit Unicode character encoding scheme; defined inclusion of PNG, JPEG and EMF picture types in Base16 (the default) or binary format in a RTF file. Also contained a Japanese local RTF specification called RTF-J for the Japanese version of Word; RTF-J is somewhat different from the standard RTF specification. 1.6 May 1999 Microsoft Word 2000/Word 9 1999 Included Pocket Word and Exchange (used in RTF-HTML conversions). 1.7 August 2001 Microsoft Word 2002/Word 10 2001 8/2001– Word 2002 RTF Specification 1.8 April 2004 Microsoft Word 2003/Word 11 2003 10/2003– Word 2003 RTF Specification 1.9.1 19. March 2008 (RTF 1.9 – published in January 2007) Microsoft Word 2007/Word 12 2006 Allowed XML markup – Custom XML Tags, SmartTags, Math elements in an RTF document, password protection, elements corresponding to Office Open XML Ecma-376 Part 4

Code syntax RTF is programmed using groups, a backslash, a control word and a delimiter. Groups are contained within curly braces ({}) and indicate which attributes should be applied to certain text.

The backslash (\) introduces a control word, which is a specifically programmed command for RTF. Control words can have certain states in which they are active. These states are represented by numbers. For example,

indicates that the Bold text is off indicates that the Bold text is on indicates that the Italic text is off indicates that the Italic text is on indicates that the Underline text is off indicates that the Underline text is on indicates that the Subscript text is off indicates that the Subscript text is on indicates that the Superscript text is off indicates that the Superscript text is on

A delimiter is one of three things:

A space A digit or hyphen (e.g. -23, 23, 275) A character other than a digit or letter (e.g. \, /, })

As an example, the following RTF code {\rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pard This is some {\b bold} text.\par } would be rendered as follows:

This is some bold text.

Character encoding

Escape sequences are used to encode code units outside the 7-bit ASCII range. The two character escapes are code page escapes and, starting with RTF 1.5, Unicode escapes. In a code page escape, two hexadecimal digits following a backslash and typewriter apostrophe denote a character taken from a Windows code page. For example, if the code page is set to Windows-1256, 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 code page), which encodes "金".

RTF Character Set Code Page Description 0 Windows-1252 Latin alphabet, Western Europe / Americas 1 0 Default Windows API code page for system locale 2 42 Symbol (PUA-mapped) character set772Default Macintosh-compatibility code page for system locale128Windows-932Japanese, Shift JIS (Windows version)129Windows-949Korean, Unified Hangul Code (extended Wansung)130Windows-1361Korean, Johab (ASCII-based version)134Windows-936Chinese, GBK (extended GB 2312)136Windows-950Chinese, Big5161Windows-1253Greek162Windows-1254Latin alphabet, Turkish163Windows-1258Latin alphabet, Vietnamese177Windows-1255Hebrew178Windows-1256Arabic186Windows-1257Baltic204Windows-1251Cyrillic238Windows-1250Latin alphabet, Eastern Europe2551Default OEM code page for system locale

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.

Text written using only ASCII characters (especially English) can be deciphered in a plain text editor.

Features Most word processors support RTF format importing or exporting some version of RTF but don't fully support it. Unknown RTF control words are typically ignored. This means that not only the appearance but also annotations, footnotes, and tables or metadata such as author or title can silently disappear without a trace. There are several consciously designed or accidentally born RTF dialects.

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.

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 (WMF), Apple PICT, Windows device-dependent bitmap, Windows device-independent bitmap and OS/2 Metafile picture types. Not all of these picture types are supported in all RTF readers.

Some RTF writers like Microsoft Word 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 for compatibility with old versions of Word and Wordpad which increases the file size.

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: roman (serif), Swiss (sans-serif), modern (monospace), 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.