.htm File Extension

Learn what a .htm file is, which apps open HTML pages, how Poly supports the extension, and when to use .html instead.

File extension details for .htm

Partial Support
File typeHyperText Markup Language document
MIME type
EncodingText, normally Unicode UTF-8, containing HTML markup
Operating systemsWindows, macOS, Linux, iOS, Android
Opens withGoogle Chrome, Microsoft Edge, Mozilla Firefox, Safari, Visual Studio Code
Poly supportPartial. Poly provides rich HTML features when an HTM file is classified as text/html.
Indexed by PolyConditional. Correctly classified files receive full-source exact and semantic indexing.
Preview in PolyConditional. Correctly classified files open as rendered pages in Poly.
Poly agentConditional. The Poly agent can read correctly classified HTML source and reason about its structure.

What kind of file is an .htm?

An .htm file is normally a HyperText Markup Language document. It contains text markup for headings, paragraphs, links, images, forms, scripts, and other parts of a web page. .htm and .html are alternative filename extensions for the same format and use the registered text/html MIME type.1

HTML has no unique magic bytes. A page may start with <!doctype html>, whitespace, or a comment, so the opening bytes cannot prove that a file is HTML. Check the source and its supplied MIME type when a filename is misleading.1

Renaming page.html to page.htm changes only its filename. Renaming a PDF, image, or plain-text document to .htm does not convert it into a web page.

How do I open an .htm on my computer?

Open an .htm file in Chrome, Edge, Firefox, or Safari on Windows, macOS, or Linux. Mobile browsers can display one too. To inspect or change the markup, use a text or source-code editor such as Visual Studio Code.

A standalone page may appear incomplete if it refers to CSS, JavaScript, fonts, images, or data that were not saved beside it. Relative links also depend on the file's folder. MDN recommends opening a local HTML file through a browser's Open With command or by dragging it into a browser window.2

Treat unfamiliar HTM files like unfamiliar websites. HTML can run scripts, submit forms, redirect you, and request remote resources. Use an up-to-date browser, do not enter credentials into an untrusted local page, and inspect suspicious source before opening it.1

Poly support for .htm

Poly can store, sync, share, version, download, and find .htm files by name. Poly does not currently infer text/html from this suffix alone. When the correct MIME type is supplied, Poly creates a page thumbnail, provides a rendered preview, and indexes the full source for exact and semantic search.

The Poly agent can then reason about visible text, elements, links, and attributes in the stored source. A preview reflects the resources available to the file; it is not a complete capture of every linked page or network dependency.

History of .htm

Tim Berners-Lee built the first web browser and editor in 1990 and released it with the first web server in 1991.3 The shorter .htm spelling became useful on older MS-DOS FAT systems, whose 8.3 filename convention allowed at most three characters after the period.4

Modern filesystems accept longer names, but .htm remains common for compatibility and convention. The current HTML Standard lists both html and htm as commonly used extensions, without defining a difference in syntax or behavior.1

Working with .htm and alternatives

Use .htm when an existing site, publishing tool, or deployment process expects it. For a new project, .html is usually clearer, but neither suffix makes a page more modern or standards-compliant.

NeedPractical choiceTradeoff
Editable web page.htm or .htmlMay depend on companion resources
Fixed, shareable renderingPDFLoses responsive and interactive behavior
Readable content onlyMarkdown or plain textLoses much of the layout and page structure
Page plus resourcesWeb archive or site folderLess convenient than one file

For reliable modern text, save authored HTML as UTF-8. If the encoding is declared inside the document, the HTML Standard requires the complete <meta charset="utf-8"> declaration to appear within the first 1,024 bytes.5 Changing .htm to .html is a rename, not a content conversion. Converting a dynamic website to any static format captures only one state and may omit authentication, live data, or interactive behavior.

Footnotes

  1. WHATWG. HTML Standard: text/html Media Type Registration. Lists html and htm, states that HTML has no unique magic number, and documents security considerations. 2 3 4
  2. MDN Web Docs. Dealing with Files. Describes opening local HTML files and how relative paths resolve.
  3. Berners-Lee, T. The World Wide Web: A Very Short Personal History. World Wide Web Consortium.
  4. Microsoft. Naming Files, Paths, and Namespaces. Documents the older MS-DOS FAT limit of three characters in a filename extension.
  5. WHATWG. HTML Standard: Specifying the Document's Character Encoding. Requires UTF-8 for authored documents and defines placement of in-document encoding declarations.
© Poly Corp. 2026