Free tools Windows power users keep installed
One-click scans. No signup required.
The best free place to start learning Haml is the official Haml Tutorial. It walks through converting an ERB view to Haml and teaches the core syntax; then use the project’s reference for details and the Rails Getting Started guide if you need Ruby and Rails fundamentals.
Free Haml learning resources at a glance
| Resource | Best for | Format and coverage |
|---|---|---|
| Official Haml Tutorial | Beginners learning Haml syntax | A guided lesson introducing Haml as an ERB alternative for Rails views, with a practical conversion exercise. |
| Official Haml documentation landing page | Finding the right official documentation | Links to the tutorial, complete reference, FAQ, and API documentation. |
| Haml REFERENCE.md | Looking up syntax and implementation details | A reference covering command-line rendering, Rails templates, standalone Ruby use, indentation, filters, options, and Ruby evaluation. |
| Rails Getting Started guide | Building the Ruby and Rails context Haml assumes | A broader Rails guide covering application structure, MVC, data models, testing, security, and deployment; it is not a Haml tutorial. |
How to learn Haml in a practical order
- Get the Ruby basics first. Be comfortable reading expressions, method calls, hashes, and blocks. The Rails Getting Started guide is useful for framework context, although it is not a Ruby-only course.
- Install Haml and render a small template. The tutorial is Rails-oriented, but Haml can also be used from the command line or as a standalone Ruby module, as documented in the reference.
- Practice the structure and shorthand. A line beginning with
%tagcreates an HTML element. CSS-style.classand#idshorthand add class and ID attributes; attributes can also be written with a Ruby hash. Indentation expresses nesting, so indentation is part of the template’s structure. - Learn the two Ruby markers. Use
=when a Ruby expression’s return value should be inserted into the output. Use-to run Ruby without directly inserting its result. - Convert one small ERB view. The official tutorial suggests starting with a view such as
app/views/account/login.html.erb, changing it toapp/views/account/login.html.haml, and practicing on a small file. Compare the rendered HTML to check that the conversion preserves the intended output. - Keep the reference open while expanding your use. Consult it for filters, whitespace behavior, options, Rails integration, and standalone use rather than trying to memorize every feature at the outset.
What Haml changes compared with ERB
Haml is a templating engine for HTML. Like ERB, it lets a Rails view combine markup and Ruby; unlike ERB, it uses concise tag notation and indentation to express markup structure. For example, a Haml line beginning with %p represents a paragraph element, while indentation determines which elements are nested beneath others. Ruby expressions that produce visible output use =; Ruby that should run without directly appearing in the output uses -.
That compactness has a trade-off: whitespace is structural, so inconsistent indentation can alter the document hierarchy or make a template difficult to read. When converting ERB, compare the rendered HTML rather than judging the result only by how short the Haml looks.
Which resource should you choose?
- You are new to Haml: Begin with the official tutorial and complete its ERB-to-Haml practice.
- You know Haml basics but need a syntax answer: Use REFERENCE.md as a lookup guide.
- You are new to Rails as well: Pair the tutorial with Rails Getting Started to understand the framework context; do not mistake the Rails guide for Haml instruction.
- You are using Haml outside Rails: The reference is the relevant resource for command-line rendering and standalone Ruby use.
Why the official tutorial is a sensible starting point
The Haml tutorial says, “Haml feels odd for the first 20 minutes, but then after that you will be faster.” Treat that as the tutorial’s editorial encouragement, not a measured learning-time claim. Its practical advice is more useful than any promised speed gain: try the syntax, convert a small view, and inspect what it renders.
Recommended Free Tools
#1 Best Overall
The tutorial assumes Rails, while noting that its approach applies to other frameworks and standalone Haml. The official documentation separates this guided introduction from its more comprehensive reference, FAQ, and API documentation, so learners can move from a first lesson to targeted lookup without treating one page as a complete course.
Quick Recap
Best Value
Rank #4
Rank #3
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

