Portuguese orthography is based on the Latin alphabet and makes use of the acute accent, the circumflex accent, the grave accent, the tilde, and the cedilla to denote stress, vowel height, nasalization, and other sound changes. The diaeresis was abolished by the last Orthography Agreement. Accented letters and digraphs are not counted as separate characters for collation purposes.
The spelling of Portuguese is largely phonemic, but some phonemes can be spelled in more than one way. In ambiguous cases, the correct spelling is determined through a combination of etymology with morphology and tradition; so there is not a perfect one-to-one correspondence between sounds and letters or digraphs. Knowing the main inflectional paradigms of Portuguese and being acquainted with the orthography of other Western European languages can be helpful.
A full list of sounds, diphthongs, and their main spellings is given at Portuguese phonology. This article addresses the less trivial details of the spelling of Portuguese as well as other issues of orthography, such as accentuation.