Igatools: an isogeometric analysis library. We present the design of an object oriented general purpose library for isogeometric analysis, where the mathematical concepts of the isogeometric method and their relationships are directly mapped into classes and their interactions. The encapsulation of mathematical concepts into interacting building blocks gives flexibility to use the library in a wide range of scientific areas and applications. We provide a precise framework for a lot of loose, available information regarding the implementation of the isogeometric method, and also discuss the similarities and differences between this and the finite element method. We also describe how to implement this proposed design in a C++11 open source library, igatools (http://www.igatools.org). The library uses advanced object oriented and generic programming techniques to ensure reusability, reliability, and maintainability of the source code. It includes isogeometric elements of the h-div and h-curl type, and supports the development of dimension independent code (including manifolds and tensor-valued spaces). We finally present a number of code examples to illustrate the flexibility and power of the library, including surface domains, nonlinear elasticity, and Navier-Stokes computations on nontrivial geometries.