"It works great and it is stunningly fast - on production, converting 115.000 documents takes 25 seconds instead of 9 hours." — Robert S., Germany

RTF to HTML5 / XHTML converter library

ScroogeXHTML is a library which supports a subset of the Rich Text Format (RTF) standard. It converts RTF to HTML5 and XHTML standalone documents, or to fragments which can be embedded in other documents.


Supports hyperlinks, bookmarks, multi-language and LTR/RTL text, field results and simple tables


Minimizes documents using CSS font definitions and generation of local font styles for text with different attributes


Includes an API for post-processing of the intermediate DOM tree to support additional fine tuning


Easy to use, compact and fast, and requires no external runtime libraries except the SLF4J logging facade


The web-based online demo converts a RTF document to HTML5

Online demo

Picture data extraction, complimentary code for embedding BMP/JPG/PNG images as Data URIs

Conversion example 1

The RTF for this example has been created from the original RTF specification using LibreOffice.

Input (RTF document) - as shown in MS Wordpad
example 1 RTF
  • Wordpad auto-detects URLs and renders them as hyperlinks, even if they do not use a HYPERLINK field. With ScroogeXHTML, this auto-detection can be emulated in a post-processing step.
  • Wordpad renders table borders with a light grey line, even if it has no border style. This may be achieved with CSS in ScroogeXHTML.
Output (HTML document) - as shown in Mozilla Firefox
example 1 HTML
  • To create similar grey borders around table cells as in Wordpad, the custom CSS for the conversion includes a custom border format:
td {
  vertical-align: top;
  border: 1px solid silver;

Conversion example 2

The RTF for this example has been created using LibreOffice, then opened in MS Wordpad.

Input (RTF document) - as shown in MS Wordpad
example 2 RTF
  • The first picture uses the JPG format, the second uses PNG
Output (HTML document) - as shown in Mozilla Firefox
example 2 HTML

Code example


Java code

public static void main(String[] args) throws IOException {      
        ScroogeXHTML scrooge = new ScroogeXHTML();
        String html = scrooge.convert("{\\rtf1 \"Hello world!\"}"); 

HTML output

<!DOCTYPE html>
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Untitled document</title>
    <meta content="ScroogeXHTML RTF converter 10.0" name="generator">
    <p>"Hello world!"</p>
Text properties
Bold/italic/underlined ✓/✓/✓
Foreground/background/highlight color ✓/✓/✓
Subscript/superscript ✓/✓
Strikethrough/hidden ✓/✓
LTR/RTL text ✓/✓
Unicode/DBCS text ✓/✓
Language attribute
Paragraph properties
Left/right/centered/justified alignment ✓/✓/✓/✓
Left/right/first line indent ✓/✓/✓
Background color
Border box color/width ✓/✓
Space before/after ✓/✓
Numbered/unnumbered lists ① ✓/✓
Tabulators replaced by a sequence of non breaking spaces
Other content
External Hyperlinks
Internal Links (Bookmarks)
Picture data extraction
Extracted picture formats BMP/EMF/JPG/PICT/PNG/WMF
Supported picture storage types Binary / Hexadecimal
Picture data conversion ② -
Simple tables / Nested tables ✓/—
Total width
Left margin
Column width
Row height
Horizontal cell merging
Cell background color
Cell border color/width ③ ✓/✓
Output document types
XHTML 1.0 Transitional
CSS based document minimizer
Font name substitution
Advanced features
Header/Footer text
Post processing events

① uses direct text formatting, does not generate HTML ol or ul elements

② the complimentary class MemoryPictureAdapterDataURI supports embedding of JPEG and PNG pictures as Data URIs

③ experimental or unsupported feature

Prices are per developer seat.

  Jar Edition Source Edition
Lifetime license
Redistribution in single-user applications
Basic support included One year One year
Updates and upgrades included One year One year
Instant electronic delivery
Server Deployment License discount
Library source code included -
JUnit tests included -
Early access to development snapshots -
  Buy now
Buy now
① Single Developer License and Server Deployment License terms are explained here

Released 22 October 2022



The "Getting Started" user guide


API Docs

Online API documentation


Release Notes

Enhancements and bug fixes



Frequently Asked Questions



Support and sales inqueries



Technical articles and announcements

Released 22 October 2022


Installer — Source Edition:

Download »


Installer — Jar Edition:

Download »



On the library home page you will find a link to the download area for registered users. The credentials (user name and password) will be sent to you when a new release is available. New releases will also be announced on the blog at https://scroogexhtml.wordpress.com/

Go to the download section


Yes, a free online demo version is available at https://www.scroogexhtml.com/sxd

Go to the online demo

Picture Support


The library does not convert embedded pictures, it only extracts the raw picture data from the RTF document. The library may contain complimentary code for picture processing support, but this code is experimental and not covered by the basic support plan.

Privacy and Security



Yes, you may receive a discount coupon code to purchase the Source Edition at a reduced price.

Developer License


Yes, each developer that uses our products must have their own license.

No, developer licenses are perpetual. However, you will be using the last product version released before your free upgrade period expired. A license may also be revoked in case of license violations.

Source Code Distribution


No, the source code is not redistributable, even if you change it. Under no circumstances is it acceptable to disclose the source to any third party.

Server Deployment License


License types (Single Developer License and Server Deployment License) are explained on the page /scroogexhtml_license.html.

ScroogeXHTML License Types

No. A Server Deployment License covers all applications on the server.


Server Deployment Licenses are available under two license models, 'Perpetual' or 'Subscription'. When licensed as a subscription, the license expires when the subscription ends. Licenses may also expire in case of license violations.

No, the proof of purchase for Server Deployment Licenses is your license document.


No. ScroogeXHTML Server Deployment Licenses or parts of it may not be distributed, sold, rented or transferred to any other party, this includes mergers and acquisitions of the license holder.



Advocate Health Care

Artisan Design Group

Axalta Coating Systems

Becton, Dickinson and Company


General Dynamics

Glencore International AG


Iodine Software


ProClarity Corporation

QuadraMed Corporation

Working Systems Cooperative


"This is an excellent unique product that has saved us many hours of work. It is simple to use with lots of documentation." — Stewart S., UK


"It works great and it is stunningly fast - on production, converting 115.000 documents takes 25 seconds instead of 9 hours." — Robert S., Germany