Every finite-dimensional inner product space has an orthonormal basis which can be generalized to arbitrary (infinite-dimensional) inner product spaces using the GramSchmidt process (a method for orthonormalizing a set of vectors in an inner product space).
In mathematics, particularly linear algebra and numerical analysis, the GramSchmidt process is a method for orthonormalizing a set of vectors in an inner product space, most commonly the Euclidean space R equipped with the standard inner product. Every finite-dimensional inner product space has an orthonormal basis, which may be obtained from an arbitrary basis using the GramSchmidt process. In functional analysis, the concept of an orthonormal basis can be generalized to arbitrary (infinite-dimensional) inner product spaces. 
