X-ray fluorescence spectroscopy (XRF) is a non-destructive and fast technique that allows knowing the elemental composition of a sample thanks to the emission of characteristic X-rays in that sample. The TimePix pixel semiconductor detector can detect these characteristic X-rays and tell the energy of the incoming photons in each pixel. This permits to make a spatial characterization of the sample, besides the elemental characterization. This work explores X-ray fluorescence spectroscopy with the use of TimePix with the purpose of characterizing the spectra of two samples and spatially characterize a sample consisting those elements. It was possible to obtain different spectra for both elements with the device by the use of a threshold scan method, as well as to know which region of the sample consisted of which element by superpixel analysis of the count pixel matrix given by the TimePix device. The work first presents a short introduction to XRF spectroscopy in general and using TimePix. Then it presents the theoretical basis needed and finally it exposes the experimental procedures followed and their results. In the last chapter, conclusions and future work are given.