file in abyss
Back to formats

Document

RTF Rich Text Format

Rich Text Format is a document format commonly identified by .rtf. Use the listed signatures, MIME types, and structure notes to validate files beyond the extension.

Extensions .rtf
MIME application/rtf, text/rtf

Magic numbers

Analyze your file
offset 0 Rich Text Format leading signature
7B 5C 72 74 66
{\rtf

Structure

  1. Header
  2. Font table
  3. Control words
  4. Text groups

Caveats

  • Do not trust the extension alone. Check the MIME type, the first bytes such as 7B 5C 72 74 66, and format-specific structure when possible.
  • Container formats and damaged files can share the same opening bytes, so deeper validation may be required for production upload, preview, or conversion flows.

Detection example

SIGNATURE = bytes.fromhex("7b5c727466")
OFFSET = 0

def is_rtf(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

Practical usage

Use cases

Rich Text Format is used for data exchange, imports, exports, parser testing, and validation workflows. Encoding, delimiters, versions, and container structure often change implementation behavior.

Common detection mistakes

  • The .rtf extension alone does not prove the file contents. Upload and conversion flows should combine extension, MIME type, leading bytes, and format-specific structure checks.
  • Rich Text Format can start with signatures such as 7B 5C 72 74 66, but related containers and damaged files may require additional validation.

Security notes

Document formats may include scripts, attachments, macros, or external references. Sandbox previews and conversions, and avoid opening untrusted files directly.

Using samples

11 samples help test leading-byte detection, parser errors, upload limits, and download behavior.

Sample files

11 / 11 files
Sample Traits Size Source / license / SHA-256
Doc

Blue Sky RTF

Blue Sky RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

01-blue-sky.rtf
Type Sample
Small file
184 B
SHA-256 ca46ce089c878dfc268d903cb18e634fe502455a2500742864a48707e63c6ddc
Download
Doc

Flower Garden RTF

Flower Garden RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

02-flower-garden.rtf
Type Sample
Small file
242 B
SHA-256 915800782ddea2e4e4bcf64c1de1ea6041ce385f99ce3fd48943aa4de28289aa
Download
Doc

Navy Blue Sky RTF

Navy Blue Sky RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

03-navy-blue-sky.rtf
Type Sample
Small file
249 B
SHA-256 14e55c9ca5e4611245aeafb27928a0a0f2df1e752e889115a64cca98c1155702
Download
Doc

Nature of the Sky RTF

Nature of the Sky RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

04-nature-sky.rtf
Type Sample
Small file
256 B
SHA-256 b710eefc8fb8b2966bed7a4d98f0a6c213238e9ee43fe6423ffba92b2cc5e901
Download
Doc

Sky Landscape RTF

Sky Landscape RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

05-sky-landscape.rtf
Type Sample
Small file
342 B
SHA-256 332089461015ea27eab1e0d60f51d146d349973d9545d65e46164fc47e7ec621
Download
Doc

Starry Sky RTF

Starry Sky RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

06-starry-sky.rtf
Type Sample
Small file
268 B
SHA-256 c3222088a1b69243cf944ab189e61ca4e487077d0f95be7f952adb471d96fd5d
Download
Doc

Blue Night Sky RTF

Blue Night Sky RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

07-blue-night-sky.rtf
Type Sample
Small file
313 B
SHA-256 ffd9fb1fcb1233b02129b1ff29b537a7f10b5d8f1d78a842911a44a68ba768b5
Download
Doc

Hibiscus Flower RTF

Hibiscus Flower RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

08-hibiscus-flower.rtf
Type Sample
Small file
445 B
SHA-256 4d12c8526787593fb26dca21259ee6d13c22ad03f13cae14df94cb3beb794833
Download
Doc

Arctic Sky RTF

Arctic Sky RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

09-arctic-sky.rtf
Type Sample
Small file
387 B
SHA-256 9c14832a446200557a1ff38c9a0a066f1cfcfd7c635fa48301f894bdaca4dd15
Download
Doc

Sunset Rays RTF

Sunset Rays RTF is a Rich Text Format sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

10-sunset-rays.rtf
Type Sample
Small file
414 B
SHA-256 390d4af0959bf64bc2020ab4ca4eead0f7c14a3c55330a9bd6532b39f3dedb1e
Download
Doc

NASA Blue Marble RTF

NASA Blue Marble RTF is a Rich Text Format sample based on NASA Image and Video Library. It can be used to test downloads, parsers, previews, and file type detection.

nasa-blue-marble-2012-east.rtf
Type Sample
Small file
720 B
SHA-256 e5b07989f55a9da71bfdb9fdcd1e17ea45aea807d25571cca6da9886e0fc908c
Download

Frequently asked questions

What is the magic number (file signature) of Rich Text Format?

Rich Text Format files begin with the byte signature 7B 5C 72 74 66 ("{\rtf"). Detect the format by reading these leading bytes rather than trusting the file extension alone.

What is the MIME type of Rich Text Format?

The MIME type for Rich Text Format is application/rtf, text/rtf.

What file extension does Rich Text Format use?

Rich Text Format files use the .rtf extension. The extension is a convention only and does not guarantee the file contents, so combine it with signature and structure checks.

Related formats