An X-ray computed-tomography (CT) apparatus of an embodiment includes an X-ray tube, an X-ray detector, and processing circuitry. The X-ray tube is configured to generate an X-ray. The X-ray detector includes a plurality of X-ray detection elements configured to output a signal based on the X-ray entered therein. The processing circuitry is configured to derive a constraint condition by using at least one piece of projection data out of a plurality of pieces of projection data corresponding energy bins of which differ at least partially, calculate an effective length that is a total length for which the X-ray has passed through a region in which a material to be decomposed is present, and generate image data showing information about the material by using the projection data and the effective length.