Free TOML test files and sample generator
A modern, readable config format with typed values and [tables]. Generate valid .toml files for testing parsers, Rust/Python tooling and CI configs.
What is a .toml file?
TOML: Tom's Obvious Minimal Language. TOML was designed to be an unambiguous configuration format. It is what Rust's Cargo, Python's pyproject and many modern tools use. Unlike YAML it has no indentation significance, so parse results are predictable.
Why generate a test TOML file?
- Test a config parser against tables and typed values.
- Verify tooling reports precise errors on invalid syntax.
- Check handling of a large generated configuration.
How a .toml file is identified
A .toml file has no signature at the start. A text format has no identifying leading bytes, so the extension and the reported media type are the only claims about it until a parser actually reads it, which is why validating uploads by extension alone is unsafe.
How the size lands on the exact byte
The format allows comments, so the padding is comment lines, legal, inert, and visible if you open the file.
Negative testing with broken TOML files
- Invalid. Identifiable, but wrong inside, so it fails during parsing.
- Corrupted. The leading bytes are destroyed. 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, and for this format's encodings, UTF-16 and BOM test files.
Sample TOML content
title = "STD" [settings] key_0 = 137
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
Validate with `python -c "import tomllib,sys;tomllib.load(open(sys.argv[1],'rb'))" file.toml`.
Media type application/toml · extension .toml · category Config & DevOps
Generate a .toml file → · questions about sizes, privacy or cost are answered on the site FAQ.
Frequently asked questions about TOML files
What identifies a .toml file?
Nothing at the start of the file does. A text format has no identifying leading bytes, so the extension and the reported media type are the only claims about it until a parser actually reads it, which is why validating uploads by extension alone is unsafe.
How can a .toml file be an exact number of bytes?
The format allows comments, so the padding is comment lines, legal, inert, and visible if you open the file.
Can I download several broken TOML files at once?
Yes, select more than one File Condition and you get one ZIP containing a .toml per condition, each named after its condition.
Can the TOML file use UTF-16 or a byte-order mark?
Yes. .toml is a text format, so it can be generated as UTF-8, UTF-8 with a byte-order mark, UTF-16 LE or UTF-16 BE. The body is shortened before re-encoding so the finished file still lands on the exact size you asked for. Note that a UTF-16 file always has an even byte count.
How do I open or verify the TOML file?
Validate with python -c "import tomllib,sys;tomllib.load(open(sys.argv[1],'rb'))" file.toml.
Related Config & DevOps formats
ENV · INI · Dockerfile · gitignore · CONF · Properties · Makefile · EditorConfig