Free ODG test files and sample generator
The OpenDocument vector drawing format used by LibreOffice Draw. Generate valid .odg sample files to test document tooling, converters and uploads.
What is a .odg file?
ODG: OpenDocument Drawing. ODG is the OpenDocument drawing format used by LibreOffice Draw, vector shapes, text boxes and pages, stored as XML in a ZIP package.
Why generate a test ODG file?
- Test handling of vector drawing documents in a converter or viewer.
- Check that a document pipeline does not assume every ODF file is text.
- Exercise multi-page drawing extraction.
What you can put inside a .odg file
You get 3 content options for ODG, so the file holds something meaningful rather than random padding: Shapes, Text, Multi-page. For ODG these are alternatives, so choose the one that matches what you need to test.
How a .odg file is identified
Every .odg file begins with 50 4B 03 04, the ASCII letters "PK", the initials of Phil Katz, who created the ZIP format. That is what a validator inspecting content rather than the file name looks for.
How the size lands on the exact byte
The package is a ZIP, so the padding is trailing whitespace inside one of the XML parts it already contains. Extractors and Office readers both ignore it, so the document opens unchanged.
Negative testing with broken ODG files
- Invalid. Identifiable, but wrong inside, so it fails during parsing.
- Corrupted. The leading bytes are destroyed, so the
50 4B 03 04identifying a .odg 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 ODG content
[ODG], ZIP package: mimetype + META-INF/manifest.xml + content.xml (office:drawing).
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 LibreOffice Draw, or convert with `libreoffice --convert-to pdf file.odg`.
Media type application/vnd.oasis.opendocument.graphics · extension .odg · category Doc & TXT
Generate a .odg file → · questions about sizes, privacy or cost are answered on the site FAQ.
Frequently asked questions about ODG files
What identifies a .odg file?
A .odg file begins with the bytes 50 4B 03 04, the ASCII letters "PK", the initials of Phil Katz, who created the ZIP format. Those bytes are what a content-sniffing validator looks for, and what the Corrupted condition destroys.
How can a .odg file be an exact number of bytes?
The package is a ZIP, so the padding is trailing whitespace inside one of the XML parts it already contains. Extractors and Office readers both ignore it, so the document opens unchanged.
What can go inside the ODG file?
There are 3 content options for .odg: Shapes, Text, Multi-page. For ODG these are alternatives, so pick the one matching what you need to test.
Can I download several broken ODG files at once?
Yes, select more than one File Condition and you get one ZIP containing a .odg per condition, each named after its condition.
Can the ODG file use UTF-16 or a byte-order mark?
No, and deliberately. A .odg 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 ODG file?
Open in LibreOffice Draw, or convert with libreoffice --convert-to pdf file.odg.