Free HTML test files and sample generator
The markup language of the web. Used for rendered content, email templates and scraping test fixtures.
What is a .html file?
HTML: HyperText Markup Language. HTML is the document format of the web. As a test artifact it is useful because browsers are extremely forgiving, which means a file that renders fine can still be invalid, and your own parser may not be as tolerant.
Why generate a test HTML file?
- Test an HTML sanitizer, scraper or email-template renderer with a real document.
- Check how an upload path handles a file that browsers will execute if served incorrectly.
- Measure render and parse performance on a large page.
What you can put inside a .html file
You get 7 content options for HTML, so the file holds something meaningful rather than random padding: Article (headings + paragraphs), Table, Form, List, Image, Bar chart, Pie chart. Pick several and they are merged into one file, with a section, sheet, slide or folder for each.
How a .html file is identified
A .html 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
An HTML comment carries the padding, so nothing extra renders in the browser.
Negative testing with broken HTML 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 HTML content
<article> <h1>Test User</h1> <p>Status: <b>active</b></p> </article>
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 any browser, or check with the W3C validator / `tidy -errors file.html`.
Media type text/html · extension .html · category Doc & TXT
Generate a .html file → · questions about sizes, privacy or cost are answered on the site FAQ.
Frequently asked questions about HTML files
What identifies a .html 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 .html file be an exact number of bytes?
An HTML comment carries the padding, so nothing extra renders in the browser.
What can go inside the HTML file?
There are 7 content options for .html: Article (headings + paragraphs), Table, Form, List, Image, Bar chart, Pie chart. 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 HTML files at once?
Yes, select more than one File Condition and you get one ZIP containing a .html per condition, each named after its condition.
Can the HTML file use UTF-16 or a byte-order mark?
Yes. .html 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 HTML file?
Open in any browser, or check with the W3C validator / tidy -errors file.html.