file in abyss
Back to formats

Web

HTML HyperText Markup Language

HyperText Markup Language is a web format commonly identified by .html, .htm. Use the listed signatures, MIME types, and structure notes to validate files beyond the extension.

Extensions .html, .htm
MIME text/html

Magic numbers

Analyze your file
offset 0 HyperText Markup Language leading signature
3C 21 64 6F 63 74 79 70 65
<!doctype

Structure

  1. Doctype
  2. html
  3. head
  4. body

Caveats

  • Do not trust the extension alone. Check the MIME type, the first bytes such as 3C 21 64 6F 63 74 79 70 65, and format-specific structure when possible.
  • Container formats and damaged files can share the same opening bytes, so deeper validation may be required for production upload, preview, or conversion flows.

Detection example

SIGNATURE = bytes.fromhex("3c21646f6374797065")
OFFSET = 0

def is_html(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

Practical usage

Use cases

HyperText Markup Language is used for data exchange, imports, exports, parser testing, and validation workflows. Encoding, delimiters, versions, and container structure often change implementation behavior.

Common detection mistakes

  • The .html / .htm extension alone does not prove the file contents. Upload and conversion flows should combine extension, MIME type, leading bytes, and format-specific structure checks.
  • HyperText Markup Language can start with signatures such as 3C 21 64 6F 63 74 79 70 65, but related containers and damaged files may require additional validation.

Security notes

Untrusted input is not safe just because the format was detected. Account for parser exceptions, large files, unexpected encodings, and external references.

Using samples

11 samples help test leading-byte detection, parser errors, upload limits, and download behavior.

Sample files

11 / 11 files
Sample Traits Size Source / license / SHA-256
Web

Blue Sky HTML

Blue Sky HTML is a HyperText Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

01-blue-sky.html
Type Sample
Small file
347 B
SHA-256 3da0e54ffe7186921d2a037219ac03b1327b7577620940026310443163313586
Download
Web

Flower Garden HTML

Flower Garden HTML is a HyperText Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

02-flower-garden.html
Type Sample
Small file
377 B
SHA-256 15223cb4d9e7c636861b0b5962036ead59ae9cddc063a0107e6023659047881f
Download
Web

Navy Blue Sky HTML

Navy Blue Sky HTML is a HyperText Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

03-navy-blue-sky.html
Type Sample
Small file
369 B
SHA-256 1744f855eb8576d2a4214de31d8e8d3bfdd10a74a859d59fa9beef5ac5ddba5b
Download
Web

Nature of the Sky HTML

Nature of the Sky HTML is a HyperText Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

04-nature-sky.html
Type Sample
Small file
365 B
SHA-256 b35642842f3519ebfeff7568034fbda82b01eaa8c9a01b09f7469d1c52fe348b
Download
Web

Sky Landscape HTML

Sky Landscape HTML is a HyperText Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

05-sky-landscape.html
Type Sample
Small file
372 B
SHA-256 d50339721c2fbfcc006ae76b198de485d019103bb70bd58fbfdef43f224fd6c8
Download
Web

Starry Sky HTML

Starry Sky HTML is a HyperText Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

06-starry-sky.html
Type Sample
Small file
352 B
SHA-256 2a154d8e8e02c49a0483645749ee5d7078f143a9d66ceff82aeaf2c29eda3e08
Download
Web

Blue Night Sky HTML

Blue Night Sky HTML is a HyperText Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

07-blue-night-sky.html
Type Sample
Small file
356 B
SHA-256 c2587341751a1e1e84dc0faf4faf3fac8a7b299635aeabc79ef38a7381f0d682
Download
Web

Hibiscus Flower HTML

Hibiscus Flower HTML is a HyperText Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

08-hibiscus-flower.html
Type Sample
Small file
384 B
SHA-256 6e078c2a2cff9855876aa42f18abdfb7113a8455794c9a44aabaa9af58ff6d2c
Download
Web

Arctic Sky HTML

Arctic Sky HTML is a HyperText Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

09-arctic-sky.html
Type Sample
Small file
360 B
SHA-256 68603539b4b96df6f2131a7cc875e66f8b91cae9a7dba52202429c5efb52798c
Download
Web

Sunset Rays HTML

Sunset Rays HTML is a HyperText Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

10-sunset-rays.html
Type Sample
Small file
358 B
SHA-256 4637d3e25d6f3da6144f5d06afe94380772515c4c57080c1d77232a6335af455
Download
Web

NASA Blue Marble HTML

NASA Blue Marble HTML is a HyperText Markup Language sample based on NASA Image and Video Library. It can be used to test downloads, parsers, previews, and file type detection.

nasa-blue-marble-2012-east.html
Type Sample
Small file
410 B
SHA-256 f7cee2a714ce3bf7b25a8dbeb549df87ffbe6b43accc032186bca5cc84e6fcc9
Download

Frequently asked questions

What is the magic number (file signature) of HyperText Markup Language?

HyperText Markup Language files begin with the byte signature 3C 21 64 6F 63 74 79 70 65 ("<!doctype"). Detect the format by reading these leading bytes rather than trusting the file extension alone.

What is the MIME type of HyperText Markup Language?

The MIME type for HyperText Markup Language is text/html.

What file extension does HyperText Markup Language use?

HyperText Markup Language files use the .html, .htm extension. The extension is a convention only and does not guarantee the file contents, so combine it with signature and structure checks.

Related formats