Some people have trouble determining when accent marks (tildes) should be used and where.
What are the rules for accent placement in Spanish? How do you determine whether the vowel on the stressed syllable should have an accent mark or not?
There are three main categories of words in Spanish, according to what syllable the stress falls on: agudas, llanas o graves, and esdrújulas. Let's see what these terms mean.
Words are divided in syllables. In order to know which syllable gets a tilde, or written accent mark, you need to count the syllables. The counting goes from the last syllable towards the beginning of the word:
Agudas: These are the words that have the stress on the last syllable. They get the tilde if they end in -s, -n, or vowel.
café, posición, estás, etc.
Llanas o graves: The words falling into this category have the stress on the penultimate (second to last) syllable. They get the tilde when they don't end with -s and -n or vowel (the opposite situation from the first category I listed).
cónsul, López, carácter, etc.
Esdrújulas: These words have the stress falling on the third to last and fourth to last syllable. These words are always written with a tilde.
práctica, próximo, jóvenes, diciéndoselo, etc.
You put a tilde also on words that have hiatus formed by strong vowels (a, e, o) and weak vowels (i, u), such as:
período, Raúl, actúan, filosofía, etc.
Note that the case of the fourth-to-last syllable can also be called by a specific term, "sobreesdrújula." Example: Less common are the words with the stress falling on the fourth-to-last syllable, such as diciéndoselo.
Adverbs ending with -mente get the accent when they come from an adjective that has it: rápido → rápidamente, cordial → cordialmente. (Source)
Last, but not least, you use it on words that have ambiguity or that require the tilde in special situations:
- tú (subject pronoun) – tu (possessive pronoun)
- él (pronoun) – el (article)
- cuándo (in a question) – cuando (in a statement, or used as a conjunction)
sólo – solo(deprecated rule)
- ... etc.
Note: the examples were taken from the Italian Wikipedia page.
I support the answer by Alennano. However, I will write an answer that takes a slightly different point of view, intended to be especially practical and useful for a Spanish learner or a heritage speaker who is unsure about written accent marks:
Rule 1. If there is a tilde:
- the stress will go where you see the tilde. (lápiz)
Rule 2. If the word has no tilde mark, and it ends in n, s or vowel:
- The stress will go on the second-to-last syllable. (hablan, hablas, habla)
Rule 3. If the word has no tilde mark, and it ends in a consonant other than n or s:
- The stress will go on the last syllable. (personal, verdad, Imam, hablar, capaz)
The flip side of the above comes next.
First, write the letters of the word. Then, applying Rules 2 and 3 from above, pronounce what you've written. If the pronunciation comes out right then you don't need to write an accent mark. Otherwise, you do.
For the fine points having to do with diphthongs and semantic differentiation, please see the answer by Alennano.