Disclosed are deuterated chenodeoxycholic acid derivatives and pharmaceutical compositions containing the deuterated chenodeoxycholic acid derivatives. In particular, disclosed is a deuterated chenodeoxycholic acid derivative of formula (I), or a crystal form, pharmaceutically acceptable salt, hydrate or solvate thereof, and a pharmaceutical composition containing the same. The deuterated chenodeoxycholic acid derivatives of formula (I) can be used to treat and/or prevent diseases related to the farnesoid X receptor (FXR) and/or G-protein coupled bile acid receptor, such as nonalcoholic steatohepatitis, nonalcoholic fatty liver diseases, gallstones, primary biliary cirrhosis, and cirrhosis.