Stress marks and written accents
Spanish is very different from English, which has no written accents. It is also different from French, where the written accents are used to change the sounds of the words and there is a clear and marked difference between e (femme), é (e acute -- école), and è (e grave -- père, mère), not to mention ê (e circumflex -- être).
In Spanish, written accents are used to show where the words are stressed, ie where the stress falls on each word. Thus, where we say telephone in English, Spanish says teléfono, sressing the second é on which the written accent, and hence the stress, falls.
There are three simple laws and a couple of bye-laws, so to speak, governing the use of written accents in Spanish. But first, some technical terms: accents may be said to fall on the ultimate (last / final) syllable of a word; on the penultimate (last but one / one before the final) syllable, and on the antepenultimate (second from the end) syllable. Ultimate, penultimate, and antepenultimate, are useful words to remember where written accent and stress is concerned.
Law 1: Ultimate -- words ending in a consonant, other than n or s, are stressed on the last (ultimate) syllable. Examples: mujer, papel, profesor, hablar, ciudad etc.
Law 2: Penultimate -- words ending in a vowel or in n or s (the regular plurals for verbs and nouns) are stressed on the penultimate (last but one / two from the end) syllable. Examples: poeta, clase, hablamos, casa, perro, hablo, ladro etc etc
Law 3: Any word that is not stressed according to laws 1 or 2 receives a written accent to mark where the word is stressed. Examples: Góngora, esdrújula, matemáticas, antropología, día, lápiz, lápices etc etc
Bye-laws:
Dipthongs occur when a strong and a weak vowel are used in combination; and remember that the stress usually falls on the strong vowel. If we want to stress the weaker vowel, then we must give it an accent to strengthen it. The simplest example is Mario / María, the boy's name (Mario) being stressed on the a, the girl's name (María) being stressed on the í. How do we know which vowels are weak and which are strong? Remember -- you (u) and I (i) are weak; the other three vowels (a, e, o) are strong!
Questions and exclamations receive an accent on the interrogative or exclamatory word: ¿Qué dices? (Question: what are you saying?) ¿Cómo te llamas? (What do you call yourself ie what is your name?). ¡Qué bien! (Exclamation: "That's great!").
Differentiation when two words are spelled the same, one will carry a written accent. For example, si and sí. Does Sí have an accent? YES, when it means yes, and if not it means if. Again, tu and tú, or el and él. Each word in these pairs has a different funtion, even though it has more or less the same form. Thus, tu (no accent) is a possessive adjective, ie one that denotes possession: tu libro / your book, tu nombre / your name, whereas tú (with an accent) is a subject pronoun and serves as the subject of a verb: tú hablas español con tu hermano / you speak Spanish with your brother. In the other pair above el (no accent) is the definite article el libro / the book and él (with an accent) is the subject pronoun he; this can give us the sentence, easy to remember, él tiene el libro / he has the book.
Remember these simple examples: they are mnemonic and will help to make your learning of Spanish that much easier and more accurate.