All formats

RTF libraries

Most RTF libraries do one of two things: extract plain text (strip the markup) or convert RTF to HTML. Full-fidelity RTF reading and writing lives in word processors (LibreOffice, Word) rather than in libraries; for that, convert with soffice --headless --convert-to docx and use a DOCX library.

Language Library Read Write Notes
C# RtfPipe yes (to HTML) no RTF to HTML with tables, lists, pictures, Outlook HTML de-encapsulation
Java RTFEditorKit yes yes built into the JDK (Swing), basic formatting only
Java RTF Parser Kit yes no event parser with full encoding handling, text extraction
Python striprtf yes (to text) no small, pure Python text extraction
Ruby ruby-rtf yes no parses into formatted sections, fonts, colors, tables
Rust rtf-parser yes no lexer + parser into styled blocks, no dependencies
PHP PHPWord yes (basic) yes Word/ODT/RTF document library; writes RTF from an object model

Not covered by a page: for C and C++ there’s no maintained RTF library (GNU unrtf is a command line converter); in Go, small packages such as github.com/attilabuti/striprtf extract text but have few users; in .NET on Windows, the WinForms RichTextBox control loads RTF and exposes .Text.

By language#