announcement

Share the latest technology trends or photos of gadgets you love.

Everything You Need to Know About the RTF File Format

RTF or Rich Text File format was formalized in 1987 by Charles Simonyi, Richard Brodie, and David Luebbert from the Microsoft Word development team, for document interchange over cross-platforms. So what is an RTF file? Let's find out...
Prachi Patkar
Did You Know?
RTF files basically consist of commands written in ASCII codes. A single file consists of only 7-bit ASCII characters.

Microsoft developed RTF to bridge the gap between word processing software and system compatibility. RTF 1.0 version syntax was based on 'TeX', a macro and token-based typesetting language. It was developed by Microsoft Corporation for the purpose of formatting documents. Besides RTF, other formatting languages are HTML (Hypertext Markup Language) and SGML (Standard Generalized Markup Language). HTML provides formatting to documents over the World Wide Web. SGML is a richer version of HTML.

Type of File Rich Text Format File
File Classification Type Text
File Extension .rtf
Uniform Type Identifier public.rtf
Strings Identified ASCII: {\rtf
Hexadecimal: 5C, 7B, 72, 72, 66

In RTF files, the characters beyond ASCII range are encoded by using 'escape sequences'. Escape sequences are classified into: 'Unicode escapes' and 'code page escapes'.

Unicode Escapes: \u is the control word used. This word is followed by a 16-bit signed decimal integer. This integer describes the Unicode UTF-16 unit number.

Code Page Escapes: \'c8 is the control word used. This word containing a backslash and apostrophe is followed by representation of a character used from the Windows code page.

These commands are mainly written to define factors such as text formatting, text font, images embedded within the text, margin, etc. Formatting is necessary for various documents, such as resumes, letters, user manuals, etc. The basic functionalities of RTF documents include bold, italic, underline, font styles, margin, and alignment (left, center, right).

Concept of RTF Reader and Writer
A software that converts an RTF file into a formatted file is called a 'reader'. A software which converts a formatted file into an RTF file is called a 'writer'. Its task (for an application) involves separating the control information code from the text component. It then writes a new file with the text and associated RTF groups.

RTF Code Example
{
\rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pard
This is some {\b bold} text.\par
}
This file, when read by a program that supports RTF, would display the following output.
This is some bold text.

Definition Of Code Components
  • {} (braces)
    The code snippet is written within curly braces. They define a group.
  • \
    This character (backslash) is used to define the start of the control code of an RTF file.
  • \rtf
    This is written to indicate that the RTF document is valid. A valid document is said to be the one in which the group starts with \rtf control code.
  • \b
    This indicates bold type text.
  • \par
    This is a control code for indicating end of a paragraph.
The snippet { \b bold } indicates that the scope of 'bold' style is limited to the word 'bold'. Nesting of groups, that is a group within group, is allowed in RTF files.

RTF Versions Timeline
RTF Version Year MS Word Version
RTF 1.0 1987 Microsoft Word 93
RTF 1.1 1991 Microsoft Word 4
RTF 1.2 1993 Microsoft Word 5
RTF 1.3 1994 Microsoft Word 6
RTF 1.4 1995 Microsoft Word 95
RTF 1.5 1997 Microsoft Word 97
RTF 1.6 1999 Microsoft Word 2000
RTF 1.7 2001 Microsoft Word 2002
RTF 1.8 2004 Microsoft Office 2003 Editions
RTF 1.9.1 2008 Microsoft Office 2007 Suites, Microsoft Office Word 2007

Advantages of RTF Files
File Compatibility: The most important feature of an RTF file is its compatibility with numerous operating systems and word processing applications.

Free from Viruses: Attached files (with .doc extension) are less trusted by business organizations or email servers as they can contain viruses. Unlike .doc files, .rtf files don't contain macros or viruses that can hamper the word documents.

File Size: If a file contains only text data, then saving the file with .doc extension results in a larger file size. However, if the same file is saved as a .rtf file, it is smaller than the .doc file. RTF files use text-based encoding. This is advantageous, because smaller files are easier to download/upload, and also save disk storage space.

Disadvantages of RTF Files
Security: RTF files cannot be password protected. If the file contains confidential data which needs security, then it is advisable to use Word.

File Size: If a file contains images, Word-Art, etc, the size of the file is incredibly larger than corresponding .doc file. This is disadvantageous as it consumes more download/upload time as well as occupies more disk space.

RTF File Conversion
Steps to Save a New File in RTF
  1. Create the file in a word processing software.
  2. Click on 'File' menu ►'Save As' option.
  3. On clicking 'Save As', a selection box appears. Enter a suitable name for the file in the 'File Name' field.
  4. In the 'Save as Type', select the file type as Rich Text Format (*.rtf) from the drop-down list.
  5. Click on 'Save' to save the file.
Only one file will be created with .rtf extension.

Steps to Save a Different Extension File in RTF
  1. Open the already created file that needs to be saved in .rtf.
  2. Click on 'File' menu ► 'Save As' option.
  3. On clicking 'Save As', a selection box appears. Enter a suitable file name in the 'File Name' field.
  4. In the 'Save as Type', select the file type as Rich Text Format (*.rtf) from the drop-down list.
  5. Click on 'Save' to save the file.
A new file will be created with an .rtf extension, whereas, the old file will be retained with its original extension.

Steps for Creating an RTF File in Word 2007
  1. Click on the 'Office' button.
  2. Click on 'Save As'. On clicking 'Save As', a selection box appears. Enter a suitable file name in the 'File Name' field.
  3. In the 'Save as Type', select the file type as Rich Text Format (*.rtf) from the drop-down list.
  4. Click on 'Save' to save the file.
An RTF file can be changed to different file formats too while saving the word document. Free 'RTF Document Converters' are available on the Internet which can convert documents and E-books to RTF files.