Free HTML sample, test and dummy files
The markup language of web pages. As an upload it needs careful handling because browsers will execute it. Download valid HTML test files in 19 exact sizes, from 1 KB to 100 MB, each with a checksum. Or create one of any size up to 1 GB.
- Extension
- .html
- MIME type
- text/html
- Kind
- Text
- Category
- Documents
Create a HTML file of any size
Choose any size from 700 bytes to 1 GB. The file is made in your browser, so nothing is downloaded from our server. Smaller files usually finish quickly; generation time depends on your device and format. Larger ones are streamed straight into your downloads list in browsers that support it (current Chrome, Edge and Firefox on computers and Android); elsewhere, such as Safari and every browser on iPhone and iPad, the largest size is lower and is shown below.
HTML files by size
Every file below is a valid HyperText Markup Language file of exactly the stated size. Open a file's page for its checksum and contents, and to preview it in your browser before downloading.
| File | Size | Contents | Download |
|---|---|---|---|
| 1 KB HTML samplesample-html-1kb.html | 1 KB1,024 bytes | Sections: 0 | Download HTML |
| 5 KB HTML samplesample-html-5kb.html | 5 KB5,120 bytes | Sections: 5 | Download HTML |
| 10 KB HTML samplesample-html-10kb.html | 10 KB10,240 bytes | Sections: 12 | Download HTML |
| 25 KB HTML samplesample-html-25kb.html | 25 KB25,600 bytes | Sections: 31 | Download HTML |
| 50 KB HTML samplesample-html-50kb.html | 50 KB51,200 bytes | Sections: 63 | Download HTML |
| 100 KB HTML samplesample-html-100kb.html | 100 KB102,400 bytes | Sections: 127 | Download HTML |
| 200 KB HTML samplesample-html-200kb.html | 200 KB204,800 bytes | Sections: 254 | Download HTML |
| 500 KB HTML samplesample-html-500kb.html | 500 KB512,000 bytes | Sections: 636 | Download HTML |
| 1 MB HTML samplesample-html-1mb.html | 1 MB1,048,576 bytes | Sections: 1,303 | Download HTML |
| 2 MB HTML samplesample-html-2mb.html | 2 MB2,097,152 bytes | Sections: 2,604 | Download HTML |
| 3 MB HTML samplesample-html-3mb.html | 3 MB3,145,728 bytes | Sections: 3,905 | Download HTML |
| 5 MB HTML samplesample-html-5mb.html | 5 MB5,242,880 bytes | Sections: 6,511 | Download HTML |
| 10 MB HTML samplesample-html-10mb.html | 10 MB10,485,760 bytes | Sections: 13,014 | Download HTML |
| 15 MB HTML samplesample-html-15mb.html | 15 MB15,728,640 bytes | Sections: 19,505 | Download HTML |
| 20 MB HTML samplesample-html-20mb.html | 20 MB20,971,520 bytes | Sections: 25,997 | Download HTML |
| 25 MB HTML samplesample-html-25mb.html | 25 MB26,214,400 bytes | Sections: 32,487 | Download HTML |
| 30 MB HTML samplesample-html-30mb.html | 30 MB31,457,280 bytes | Sections: 38,979 | Download HTML |
| 50 MB HTML samplesample-html-50mb.html | 50 MB52,428,800 bytes | Sections: 64,941 | Download HTML |
| 100 MB HTML samplesample-html-100mb.html | 100 MB104,857,600 bytes | Sections: 129,799 | Download HTML |
What is an HTML file?
HTML describes the structure of a web page with nested elements such as headings, paragraphs and links. Browsers parse it very forgivingly, following the rules of the WHATWG HTML Living Standard.
An HTML file that a site stores and serves back from its own domain runs with that site's privileges, which is why user-uploaded HTML is a well-known source of cross-site scripting.
How to recognise an HTML file
Software recognises an HTML file by its file signature: fixed bytes at the start of the file, also called magic bytes or a magic number.
| Extension | .html |
|---|---|
| MIME type | text/html |
| Standard | HTML Living Standard (WHATWG) |
| Extensions | .html and .htm |
| Encoding | UTF-8, declared with <meta charset> |
| Can contain | Markup, inline CSS, scripts, references to external resources |
What to test for
These are the behaviours that most often go wrong when software handles HTML files.
- Serve uploaded HTML with Content-Disposition: attachment or from a separate domain, and send X-Content-Type-Options: nosniff.
- A text file that merely starts with a tag can be sniffed as HTML by older browsers if the Content-Type header is missing.
Strengths of HTML
- Opens in every browser with no extra software.
- Parsers are extremely forgiving, so imperfect markup still displays.
Limitations of HTML
- A complete page usually depends on separate CSS, script and image files.
- Executes in the browser, so untrusted HTML is a security risk.
Typical uses of HTML test files
- Testing HTML sanitisers and upload filters
- Checking Content-Type and Content-Disposition handling
- Testing scrapers and HTML-to-text conversion
Software that opens HTML
- All web browsers
- Code editors and IDEs
- HTML parsers such as html5lib, jsdom and Beautiful Soup
Specifications
Related
HTML sample files: questions
- Do the HTML samples run any scripts?
- No. They are static documents with one small inline style block, no scripts and no external resources, and they are marked noindex.
- What is the MIME type of an HTML file?
- The MIME type is text/html. The file extension is .html.
- Is a sample HTML file the same as a dummy or example HTML file?
- Yes. Sample, test, dummy and example HTML files are different names for the same thing: an HTML file with known contents that stands in for a real one. Any file on this page will do wherever a tutorial or a test plan asks for a dummy HTML file.