RTF (.rtf)

MIME type: application/rtf
RTF document file format.
Used for cross-platform exchange of formatted text documents.
Supported by most word processors.
RTF is an acronym for Rich Text Format.
7-bit ASCII format.
Stores formatted text using a human-readable document markup language.
Developed since 1987 by Microsoft.

Import and ExportImport and Export

  • Import["file.rtf"] imports an RTF file as a Notebook expression.
  • Export["file.rtf", expr] exports a Notebook expression or elements of a notebook to RTF.
  • Import["file.rtf"] returns an expression of the form Notebook[...].
  • Import["file.rtf", elem] imports the specified element from an RTF file.
  • Import["file.rtf", {elem, suba, subb, ...}] imports a subelement.
  • Import["file.rtf", {{elem1, elem2, ...}}] imports multiple elements.
  • The import format can be specified with Import["file", "RTF"] or Import["file", {"RTF", elem, ...}].
  • Export["file.rtf", expr, elem] creates an RTF file by treating expr as specifying element elem.
  • Export["file.rtf", {expr1, expr2, ...}, {{elem1, elem2, ...}}] treats each as specifying the corresponding .
  • Export["file.rtf", expr, opt1->val1, ...] exports expr with the specified option elements taken to have the specified values.
  • Export["file.rtf", {elem1->expr1, elem2->expr2, ...}, "Rules"] uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
  • ImportString and ExportString support the RTF format.

Notebook InterfaceNotebook Interface

  • Save As exports the active notebook as an RTF file.


  • General Import elements:
  • "Elements"list of elements and options available in this file
    "Rules"full list of rules for each element and option
    "Options"list of rules for options, properties, and settings
  • Data representation elements:
  • "Notebook"a Notebook version of the RTF file
    "NotebookObject"RTF file converted to NotebookObject
  • Import and Export use the element by default for RTF files.

ExamplesExamplesopen allclose all

Basic Examples (2)Basic Examples (2)

Show the Import elements available in an RTF sample file:

Click for copyable input

Import this file as a Notebook expression:

Click for copyable input

Export a Cell expression containing typeset math to RTF:

Click for copyable input

Convert the generated file to a Notebook expression:

Click for copyable input
New in 6
New to Mathematica? Find your learning path »
Have a question? Ask support »