This thesis presents a general theory of nonequilibrium thermodynamics for information processing. Ever since Maxwell's demon was proposed in the nineteenth century, the relationship between thermodynamics and information has attracted much attention because it concerns the foundation of the second law of thermodynamics. From the modern point of view, Maxwell's demon is formulated as an information processing device that performs measurement and feedback at the level of thermal fluctuations. By unifying information theory, measurement theory, and the recently developed theory of nonequilibrium statistical mechanics, the author has constructed a theory of "information thermodynamics," in which information contents and thermodynamic variables are treated on an equal footing. In particular, the maximum work that can be extracted by the demon and the minimum work that is needed for measurement and information erasure by the demon has been determined. Additionally, generalizations of nonequilibrium relations such as a Jarzynski equality for classical stochastic systems in the presence of feedback control have been derived. One of the generalized equalities has recently been verified experimentally by using sub-micron colloidal particles. The results obtained serve as fundamental principles for information processing in small thermodynamic systems, and are applicable to nanomachines and nanodevices.