Photon-counting X-ray detector having a converter element for converting X-rays into electric signals and a plurality of pixel elements, wherein a. each pixel element of the plurality of pixel elements has a first signal processing stage for processing the electric signals in each case with at least one signal amplifier and at least one comparator for providing a digital pixel signal at a respective signal output of the first signal processing stage of a pixel element of the plurality of pixel elements, b. the signal outputs of the first signal processing stage of at least one group of pixel elements of the plurality of pixel elements are coupled by means of signal technology to a common second signal processing stage having a multiplicity of digital logic elements for digitally processing the digital pixel signals provided, c. the common second signal processing stage has a configurable switching matrix for interconnecting by means of signal technology at least one partial number of the multiplicity of digital logic elements with the respective signal outputs of the first signal processing stage of the group of pixel elements of the plurality of pixel elements, wherein the multiplicity of digital logic elements comprises at least one counting element and one readout element, wherein the at least one counting element comprises a multiplicity of counters, d. so that, following a configuration of the switching matrix, a processing chain can be provided for the digital processing of the digital pixel signals provided for each signal output of the first signal processing stage of the group of pixel elements of the plurality of pixel elements, and wherein the first signal processing stage is embodied by pixelwise pixel electronics so that a first signal processing stage, a corresponding pixel and sensor pixel electrode (16, 57) and a detection volume in the converter element can be assigned to a pixel element of the plurality of pixel elements in each case, and the second signal processing stage can be assigned as a whole only to the group of pixel elements. a. each pixel element of the plurality of pixel elements has a first signal processing stage for processing the electric signals in each case with at least one signal amplifier and at least one comparator for providing a digital pixel signal at a respective signal output of the first signal processing stage of a pixel element of the plurality of pixel elements, b. the signal outputs of the first signal processing stage of at least one group of pixel elements of the plurality of pixel elements are coupled by means of signal technology to a common second signal processing stage having a multiplicity of digital logic elements for digitally processing the digital pixel signals provided, c. the common second signal processing stage has a configurable switching matrix for interconnecting by means of signal technology at least one partial number of the multiplicity of digital logic elements with the respective signal outputs of the first signal processing stage of the group of pixel elements of the plurality of pixel elements, wherein the multiplicity of digital logic elements comprises at least one counting element and one readout element, wherein the at least one counting element comprises a multiplicity of counters, wherein the multiplicity of digital logic elements comprises at least one counting element and one readout element, wherein the at least one counting element comprises a multiplicity of counters, d. so that, following a configuration of the switching matrix, a processing chain can be provided for the digital processing of the digital pixel signals provided for each signal output of the first signal processing stage of the group of pixel elements of the plurality of pixel elements,