What is the HTM file format?
An .htm file contains markup code in Hypertext Markup Language format - it is functionally identical to .html, differing only in the three-character extension. This is a standard document format used for creating web pages and websites. .htm stores markup code used to display text, images, and other media, and remains widely used among website designers and developers.
HTM vs. HTML
Despite their apparent difference, .htm and .html extensions are identical in regard to stored data and are used for the same purposes. The .html extension is more common today, while .htm originated as a compatibility measure for legacy operating systems - DOS, Windows 3.x and OS/2 - which enforced the 8.3 file naming convention (up to 8-character filenames with 3-character extensions). An HTML document can be saved using either extension with no difference in how browsers interpret it.
HTM file capabilities
.htm files store content in plain-text markup format, which allows users to open and modify them with any standard text editor. .htm files can hold a complete web page structure. Beyond text content, they can embed or reference .css stylesheets, JavaScript, image files, audio files, video files, and links to scripts written in other languages.
Security & safety
RISK: LOWAn .htm file is plain text and is safe to open in a text editor. The caution is that HTML pages can embed JavaScript, which runs when you open the file in a browser - a malicious local .htm could attempt phishing (a fake login page) or run scripts. Treat .htm files from e-mail or untrusted downloads like any web page: don't enter credentials into a page you didn't expect, and open suspicious files in a text editor first to inspect them rather than letting a browser execute them.
Format details
in a nutshellPrograms that open HTM files
Technical details
deep spec| MIME type | text/html |
| File encoding | Plain text; UTF-8 most common, also UTF-16 and ISO 8859-1 supported |
| Binary signature | None - no fixed magic bytes; files are identified by extension or content pattern |
| Typical file start | <!DOCTYPE html> declaration or <html tag; may be preceded by a UTF-8 BOM (EF BB BF) |
| Extension origin | 8.3 filename convention enforced by DOS, Windows 3.x and OS/2 (maximum 3-character extension) |
| Relationship to .html | Functionally identical - browsers, web servers and HTTP stacks treat .htm and .html the same way |
| Governing standard | WHATWG HTML Living Standard |
| Markup model | Hierarchical element tree of opening/closing tags, attributes, text nodes, and HTML comments |
| Embeddable resource types | Inline text, inline SVG; external references to images, audio, video, CSS stylesheets, and JavaScript |
| Scripting support | JavaScript via <script> elements or linked .js files; no other scripting language runs natively |
| Character set declaration | <meta charset="UTF-8"> inside the <head> element |
| HTTP Content-Type | text/html; charset=UTF-8 |
| Static site generator output | Common output format for generators such as Jekyll, Hugo, and Eleventy |
| Source readability | Fully human-readable plain text; diff-friendly and editable in any text editor without special tools |
| Released | 1991 (HTML); .htm dates from the 8.3-filename DOS/Windows era |
| Open standard | Yes · royalty-free |
| Specification | html.spec.whatwg.org |
HTM conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about HTM files.