Download HTML Sample Files

Jump to:     File Information     Download     How to Open

Download HTML Sample Files

Below are three small HTML sample files. Each one is a complete web page that you can open in any browser, upload, or use to test HTML parsing and rendering.

[535 bytes]
[463 bytes]
[1,012 bytes]

HTML Sample File Details

SampleSizeWhat is inside
Sample1.HTML535 bytesHTML5 page with a lowercase doctype, UTF-8 and viewport meta tags, inline CSS, a heading, a comment and a link
Sample2.HTML463 bytesHTML5 page without the optional <html> start tag, with description and author meta tags
Sample3.HTML1,012 bytesPage without a doctype, so browsers render it in quirks mode, with four paragraphs using the obsolete align attribute (left, right, center and justify)

All three files are ASCII text with Windows (CRLF) line endings.

What is an HTML File?

An HTML file is a plain-text file written in HyperText Markup Language, the language that defines the structure of web pages. It contains text and tags for headings, paragraphs, links, images and forms, and a web browser reads it and displays it as a page. Today HTML is maintained by the WHATWG as the HTML Living Standard.

Most HTML pages also load CSS for styling and JavaScript for interactivity. HTML files use the .html or .htm extension and the text/html MIME type. A minimal HTML5 page looks like this:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Sample HTML</title>
</head>
<body>
  <h1>Hello, World!</h1>
  <p>This is a sample HTML file.</p>
</body>
</html>

What You Can Test With These HTML Files

  • Parsers and sanitizers: missing optional tags, comments and obsolete attributes.
  • Rendering modes: Sample 3 has no doctype and renders in quirks mode, while Samples 1 and 2 render in standards mode.
  • Uploads and security filters: features that must block, sandbox or serve HTML files as text/html.
  • Converters: HTML to PDF, HTML email tools and static site hosting.
  • Crawlers: extracting titles, meta descriptions and links.

How to Open an HTML File

Double-click an HTML file to open it in your default browser, and press Ctrl+U (Cmd+Option+U on Mac) to see its source. To edit it, use any text editor. To serve the samples from a local web server instead of opening them from disk, run this in the download folder and visit http://localhost:8000/sample-1.html:

python3 -m http.server 8000

HTML vs Related Web Files

ExtensionContains
.HTMLPage structure and content
.CSSStyles: colors, fonts and layout
.JSJavaScript code that runs in the browser
.PHPServer-side code that usually outputs HTML
.SVGVector graphics written in XML
.JSONData exchanged between web apps and APIs