Mastcam-Z is a multispectral, stereoscopic imaging investigation on the Mars 2020 mission's Perseverance rover. Mastcam-Z consists of a pair of focusable, 4:1 zoomable cameras that provide broadband red/green/blue and narrowband 400-1000 nm color imaging with fields of view from 25.6 degrees x19.2 degrees (26 mm focal length at 283 mu rad/pixel) to 6.2 degrees x4.6 degrees (110 mm focal length at 67.4 mu rad/pixel). The cameras can resolve (>= 5 pixels) similar to 0.7 mm features at 2 m and similar to 3.3 cm features at 100 m distance. Mastcam-Z shares significant heritage with the Mastcam instruments on the Mars Science Laboratory Curiosity rover. Each Mastcam-Z camera consists of zoom, focus, and filter wheel mechanisms and a 1648x1214 pixel charge-coupled device detector and electronics. The two Mastcam-Z cameras are mounted with a 24.4 cm stereo baseline and 2.3 degrees total toe-in on a camera plate similar to 2 m above the surface on the rover's Remote Sensing Mast, which provides azimuth and elevation actuation. A separate digital electronics assembly inside the rover provides power, data processing and storage, and the interface to the rover computer. Primary and secondary Mastcam-Z calibration targets mounted on the rover top deck enable tactical reflectance calibration. Mastcam-Z multispectral, stereo, and panoramic images will be used to provide detailed morphology, topography, and geologic context along the rover's traverse; constrain mineralogic, photometric, and physical properties of surface materials; monitor and characterize atmospheric and astronomical phenomena; and document the rover's sample extraction and caching locations. Mastcam-Z images will also provide key engineering information to support sample selection and other rover driving and tool/instrument operations decisions.