.haml
🌐 WebText-based

.haml File — HTML Abstraction Markup Language

text/x-haml

File Inspector

Drop any file to identify its extension and type — runs entirely in your browser

HAML

Drop a .haml file here or click to choose

Or drop any file to identify its extension

Expected MIME type:text/x-haml

Quick Facts

Extension.haml
Full NameHTML Abstraction Markup Language
MIME Typetext/x-haml
CategoryWeb
TypeText-based (human-readable)
Typical Size1 KB – 15 KB
First Appeared2006

What Is a .haml File?

HAML (HTML Abstraction Markup Language) is a template language that uses whitespace-indented syntax to generate HTML without closing tags or angle brackets. HAML uses % for element names (%div, %p, %span), . for classes, # for IDs, and indentation for nesting — producing cleaner, more readable template code than raw HTML or ERB. HAML was created in 2006 for Ruby on Rails applications and integrates deeply with the Rails ecosystem through the haml gem. A HAML template like "%h1.title Hello" compiles to "<h1 class='title'>Hello</h1>". HAML supports Ruby expression interpolation (= for output, - for execution), filters for embedding other languages (Markdown, CoffeeScript, Sass), and multiline content. The format enforces consistent indentation and clean markup structure. While HAML's adoption has been smaller than ERB (which is more familiar to HTML developers), it has a dedicated following among developers who value its conciseness and enforced structure. HAML implementations exist for Ruby, Python, PHP, JavaScript, and other languages. The format's influence is visible in other whitespace-significant template languages like Slim, Pug, and Emmet abbreviations.

How to Open .haml Files

VS Code
RubyMine
Sublime Text
vim
any text editor

Related File Extensions

More Web File Extensions

Other web formats you might encounter

Browse File Extensions by Category

Explore our reference of 259 file extensions with details, programs, and related formats.