Skip to content
pdfconversionapi

RTF to DOCX API

POST a Rich Text Format file to /v2/convert/rtf/to/docx and get a Word document back, with the RTF's table geometry, pictures, lists, links, header text and revision marks rebuilt as Word XML.

Endpoint
POST /v2/convert/rtf/to/docx
Accepts
rtf
Sample timing
26 ms median of 5 runsHow we measure
Request size
Up to 10 MB on the Free plan or 100 MB on paid plans, all files together

Request and response

Every sample below ran against the API before this page was published. Set PDFCONVERSIONAPI_KEY to your key and run it as is.

curl -sS -X POST \
  https://api.pdfconversionapi.com/v2/convert/rtf/to/docx \
  -H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
  -F File=@repair-estimate.rtf \
  -o response.json

# FileData is base64. Save the first file in converted/,
# or print the JSON error.
if jq -e '.Files' response.json > /dev/null; then
  mkdir -p converted
  name=$(jq -r '.Files[0].FileName' response.json)
  jq -r '.Files[0].FileData' response.json \
    | base64 --decode > "converted/$name"
else
  cat response.json
fi
200 OK26 ms median1 file, 13 KB
{
  "ConversionCost": 1,
  "ConversionTime": 0.026,
  "Files": [
    {
      "FileName": "repair-estimate.docx",
      "FileExt": "docx",
      "FileSize": 13468,
      "FileData": "UEsDBBQAAAAIAAAAIQDOWIks…"
    }
  ]
}

Response from our test run on 2026-11-03. ConversionTime shows the median of 5 runs. FileData is shortened here; the real response carries the whole file as base64.

The sample, converted

The same file the code sends. Download the input and the output and compare them yourself.

First page of repair-estimate.docx, rendered by the API
Input
repair-estimate.rtf (14 KB)
Output
repair-estimate.docx (13 KB)
Source
A two-page repair estimate letter from a fictional appliance shop, with a logo, a priced table, lists, a link, a footnote and a page-numbered footer. We wrote it for these pages in Rich Text Format. (CC0-1.0). How it was made
Made by
2026-11-04, API build 9eeeb0640aba

Parameters

Send these as form fields next to the file. Names are case-insensitive. If you set one of the documented options below that we don't support yet, the request fails with a 400 that names it instead of returning a file made without it.

ParameterWhat it does
FileNamestringName of the Word file: FileName=estimate-0418 returns estimate-0418.docx; by default the sample becomes repair-estimate.docx.
StoreFileboolean, default falseStore the DOCX for 3 hours and return its link instead of the document data.
UpdateFieldsboolean, default falseHas no effect on RTF input. Fields such as PAGE and TOC reach the DOCX as the text the RTF stored for them, and the output with true differed from the one without only in the modified time in its document properties.

What carries over, and what doesn't

Kept

  • The table as drawn in the RTF: column widths of 4,320, 1,080, 1,800 and 2,160 twips, blue (#1F4E79) borders, the light blue header row marked to repeat, and the totals merged across three columns
  • The logo picture at its RTF size, 1.67 × 0.67 inches
  • Bulleted and numbered lists as Word numbering
  • The header line with the shop's address
  • Heading 1 and heading 2 paragraphs as Word's Heading1 and Heading2 styles, keeping their blue color and Arial font
  • Fonts named in the RTF (Times New Roman, Arial, Courier New), bold, italic, red text and the highlight (as shading)
  • Revision marks as Word revisions with the author's name, in our test file
  • Title, subject, author, keywords and the creation time (2027-04-18 09:30) in the document properties

Lost or not yet supported

  • Footer fields: "page 1 of 2" is written as plain text, so Word shows page 1 of 2 on every page.
  • The footnote and its mark.
  • Bold and size set directly on the headings: the sample's 15 pt bold heading 1 takes Word's Heading 1 size of 20 pt and its 12 pt bold heading 2 takes Heading 2's 16 pt, neither bold.
  • Comments.
  • The header and footer distance from the page edge, which becomes 0.5 inch instead of the RTF's 0.375 inch.

Limits

  • Requests up to 10 MB on the Free plan or 100 MB on paid plans, all files and fields together.
  • 120 seconds per conversion; longer runs end with 504.
  • Fields such as a table of contents or page references come through as their stored text, not as fields Word can update.

Where teams use it

Upgrading RTF letters and templates to DOCX

Offices that kept form letters as RTF can convert the whole set and edit them in Word from then on. Table column widths, border colors and cell shading come across as set in the RTF, so forms keep their shape.

Processing RTF exports with DOCX tools

When a system exports RTF but your code reads DOCX (python-docx, docx4j, mammoth), convert on the way in. Paragraph text, runs, tables and the header are all in the usual Word XML parts.

Questions

Why is the page number fixed in the footer?

The converter writes each RTF field as the result stored with it, so the sample's footer is the plain text "Estimate 2027-0418, page 1 of 2". In Word, select the 1 and insert a Page Number field to make it live again, or do the same in word/footer1.xml from code.

Do tracked changes in the RTF stay tracked?

Yes. In our test, a word deleted and a word inserted with revision marking came through as a Word deletion and insertion by the same author, so Word can still accept or reject them. Comments in the RTF are dropped.

Will the table look the same in Word?

Its structure does: the DOCX keeps the RTF's four column widths, the border color, the header shading, right alignment of amounts and the merged totals cells. Opened in a desktop office suite, the sample's table looked like the PDF made from the RTF.

Convert your first RTF file in a minute.