Free RTF test files and sample generator
A portable document format with basic formatting that opens across nearly every word processor.
What is a .rtf file?
RTF: Rich Text Format. Rich Text Format stores formatted documents as plain, readable markup, which is why Word, WordPad and LibreOffice all open it regardless of extension. That makes it a dependable interchange format when a real binary .doc is impractical.
Why generate a test RTF file?
- Test a document viewer or converter with formatting, tables and styled runs.
- Check that a word processor opens the file without a repair prompt.
- Verify text extraction from a formatted document.
What you can put inside a .rtf file
You get 3 content options for RTF, so the file holds something meaningful rather than random padding: Paragraph text, Table, Formatted (bold / italic). Pick several and they are merged into one file, with a section, sheet, slide or folder for each.
How a .rtf file is identified
Every .rtf file begins with 7B 5C 72 74 66 31, "{\rtf1", RTF is plain text, so you can read it in any editor. That is what a validator inspecting content rather than the file name looks for.
How the size lands on the exact byte
An ignorable group marked \* takes the padding, so the visible document is unaffected.
Negative testing with broken RTF files
- Invalid. Identifiable, but wrong inside, so it fails during parsing.
- Corrupted. The leading bytes are destroyed, so the
7B 5C 72 74 66 31identifying a .rtf is gone. Same length as the valid file. - Incomplete. Truncated part-way, so it is genuinely shorter.
- Empty. Chosen under Content rather than File Condition: valid structure, no data.
Which failure to reach for, and what to assert for each, is covered in how to make a corrupted file for testing. For upload limits and type checks see testing file upload validation.
Sample RTF content
{\rtf1\ansi Software Test Data\par}This shows the shape of the file. Your download is generated fresh at the size you choose, so the values will differ.
How to open and verify the file
Open in Word, WordPad, TextEdit or LibreOffice Writer.
Media type application/rtf · extension .rtf · category Doc & TXT
Generate a .rtf file → · questions about sizes, privacy or cost are answered on the site FAQ.
Frequently asked questions about RTF files
What identifies a .rtf file?
A .rtf file begins with the bytes 7B 5C 72 74 66 31, "{\rtf1", RTF is plain text, so you can read it in any editor. Those bytes are what a content-sniffing validator looks for, and what the Corrupted condition destroys.
How can a .rtf file be an exact number of bytes?
An ignorable group marked \* takes the padding, so the visible document is unaffected.
What can go inside the RTF file?
There are 3 content options for .rtf: Paragraph text, Table, Formatted (bold / italic). Choose more than one and they are combined into a single file, a section, sheet, slide or folder per option, rather than downloaded separately.
Can I download several broken RTF files at once?
Yes, select more than one File Condition and you get one ZIP containing a .rtf per condition, each named after its condition.
Can the RTF file use UTF-16 or a byte-order mark?
No, and deliberately. A .rtf file is a container rather than plain text, so rewriting its bytes as UTF-16 would not produce a UTF-16 document. It would produce a broken file. Use a text format such as CSV, JSON or XML for encoding tests.
How do I open or verify the RTF file?
Open in Word, WordPad, TextEdit or LibreOffice Writer.