The ornamentation in the keyboard sonatas by Domenico Scarlatti is investigated in light of evidence from late seventeenth and early eighteenth century Spanish treatises and collections. Additionally, calligraphic and statistical evidence from the earliest known manuscripts and printed source for the keyboard sonatas is explored. The study is focused on three ornaments--the appoggiatura, trill, and tremulo--and concludes that: the appoggiaturas in this repertoire were short unless cadential or present in a cantabile tempo, in which case they could be one-third to two-thirds the value of the resolution note; trills were begun on the main note unless preceded by a grace note; tremulo was usually an alternation of a main note with its lower neighbor note and this ornament is normally indicated at points of harmonic prolongation. The last chapter discusses general approaches to arranging these works for the guitar and the specific influence of ornamentation on the performance of the sonatas on guitar. Details from eight sonatas arranged for the guitar are used to exemplify the conclusions of the research.