Background Flax (Linum usitatissimum L.) is a self-pollinated crop and diversified into two morphotypes for its stem fibre and seed oil. The availability of the flax reference genome sequence, previously assembled into 15 pseudomolecules, enables the characterization of important gene families. The ABC transporter and HMA gene families are considered important gene families in the control of cadmium (Cd) accumulation in crops. To date, the genome-wide analysis of these two gene families has been successfully conducted in several plant species but no systematic study is available for the flax genome. Results Here we described both gene families in flax to provide a comprehensive overview of its evolution and some support towards the functional annotation of its members. The 198 ABC transporter and 12 HMA genes identified in the flax genome were classified into eight ABC transporter and four HMA subfamilies based on their phylogenetic analysis and domain compositions. Nine of these genes, i.e., LuABCC9, LuABCC10, LuABCG58, LuABCG59, LuABCG71, LuABCG72, LuABCG73, LuHMA3, and LuHMA4, were orthologous with the Cd associated genes in Arabidopsis, rice and maize. Ten motifs were identified from all ABC transporter and HMA genes and several motifs were conserved for all genes with similar gene length, but different subfamilies had their different motif structures. Both the ABC transporter and HMA families were highly conserved among subfamilies of flax and with Arabidopsis. While four types of gene duplication were observed at different frequencies, whole-genome or segmental duplications were the most frequent with 162 genes, followed by 29 dispersed, 14 tandem and 4 proximal, suggesting that segmental duplications contributed substantially to the expansion of both gene families in flax. The rates of non-synonymous to synonymous (Ka/Ks) mutations of paired duplicated genes were mostly less than one, indicative of a predominant purifying selection. Only five pairs of genes clearly exhibited positive selection with a Ka/Ks ratio greater than one. Gene ontology analyses suggested that most flax ABC transporter and HMA genes functioned in ATP binding, transporter, catalytic, ATPase activity, and metal ion binding. The RNA-Seq analysis of eight different organs demonstrated diverse expression profiling patterns of the genes and revealed their functional or subfunctional conservation and neo-functionalization. Conclusion Characterization of the ABC transporter and HMA genes will help in the functional analysis of candidate genes in flax and other crop species.