This paper compares the time-varying cointegration and the Kalman filter techniques to estimate the Brazilian money demand between 1996 and 2015. The estimation using Kalman filtering performs better and is subsequently used to calculate the welfare cost of inflation. Taking into consideration the time variability of the interest-rate elasticity during the period, the average welfare cost amounts to 0.24% of the GDP, for an average annual inflation of 6.63%.