- In this paper we extend the $H^\infty$ functional calculus to quaternionic operators and to $n$-tuples of noncommuting operators using the theory of slice hyperholomorphic functions and the associated functional calculus, called $S$-functional calculus. The $S$-functional calculus has two versions one for quaternionic-valued functions and one for Clifford algebra-valued functions and can be considered the Riesz-Dunford functional calculus based on slice hyperholomorphicity because it shares with it the most important properties. The $S$-functional calculus is based on the notion of $S$-spectrum which, in the case of quaternionic normal operators on a Hilbert space, is also the notion of spectrum that appears in the quaternionic spectral theorem. The main purpose of this paper is to construct the $H^\infty$ functional calculus based on the notion of $S$-spectrum for both quaternionic operators and for $n$-tuples of noncommuting operators. We remark that the $H^\infty$ functional calculus for $(n+1)$-tuples of operators applies, in particular, to the Dirac operator.