Desconocido vs. extraño vs. forastero

The Spanish words 'desconocido', 'extraño', and 'forastero' can all be translated as 'stranger'. However, they are used in different contexts and have slightly different connotations.

Desconocido

In Spanish, 'desconocido' directly translates as 'unknown'. A 'desconocido' is someone you don't know at all, like a person you've never met or spoken to.
No hables con desconocidos en la calle.
(Don't talk to strangers on the street.)
Recibí una llamada de un número desconocido.
(I received a call from an unknown number.)

Extraño

'Extraño' carries a more metaphorical sense, as it can mean someone who is not just unknown, but also unfamiliar or even weird. It is commonly used to describe something unusual, strange or someone who behaves differently.
Hay un extraño en mi casa.
(There's a stranger in my house.)
Ese hombre es muy extraño, nunca lo había visto por aquí.
(That man is very strange, I had never seen him around here before.)

Forastero

The term 'forastero' normally refers to a person who is from a different town, city, or country. It often carries the association of someone from outside of the local area or community. It can also be considered synonymous with an outsider or foreigner.
Los forasteros trajeron nuevas enfermedades al pueblo.
(The outsiders brought new diseases to the town.)
La gente del pueblo no confía en los forasteros.
(The people in the town don't trust foreigners.)

Summary

'Desconocido', 'extraño', and 'forastero' all translate as 'stranger', but are used in different contexts. Use 'desconocido' for someone completely unknown, 'extraño' if they are unfamiliar or odd and 'forastero' for someone from outside local area.