HTML Codes for Spanish Language Characters

Olé! Use the occasional Spanish character in your HTML

Journalist watches Mariano Rajoy's conference on a TV screen

Pablo Blazquez / Getty Images 

Even if your website is written in only one language and does not include multilingual translations, you may need to add Spanish-language characters to the site occasionally. Use the numerical code or hex code for the specific character in your HTML

The chart below includes the HTML codes necessary to use Spanish characters that are not in the standard character set. Older browsers may not support all these codes, but newer browsers should be fine with them, so test your HTML codes before you use them.

Some Spanish characters are part of the Unicode character set, so you need to declare that in the head of your documents, as follows:

<meta http-equiv="content-type" content="text/html;charset=utf-8" />

HTML Codes for Spanish Language Characters

Here are the different Spanish characters you may want to use.

Display Friendly Code Numerical Code Hex Codes Description
Á &Aacute; &#193; &#xC1; Capital A-acute
á &aacute; &#225; &#xE1; Lowercase a-acute
É &Eacute; &#201; &#xC9; Capital E-acute
é &eacute; &#233; &#xE9; Lowercase e-acute
Í &Iacute; &#205; &#xCD; Capital I-acute
í &iacute; &#237; &#xED; Lowercase i-acute
Ñ &Ntilde; &#209; &#xD1; Capital N-tilde
ñ &ntilde; &#241; &#xF1; Lowercase n-tilde
Ó &Oacute; &#211; &#xD3; Capital O-acute
ó &oacute; &#243; &#xF3; Lowercase o-acute
Ú &Uacute; &#218; &#xDA; Capital U-acute
ú &uacute; &#250; &#xFA; Lowercase u-acute
Ü &Uuml; &#220; &#xDC; Capital U-umlaut
ü &uuml; &#252; &#xFC; Lowercase u-umlaut
« &laquo; &#171; &#xAB; Left angle quotes
» &raquo; &#187; &#xBB; Right angle quotes
¿ &iquest; &#191; &#xBF; Inverted question mark
¡ &iexcl; &#161; &#xA1 Inverted exclamation point
&euro; &#128; &#x80; Euro
&#8359; &#x20A7; Peseta

How to Use the Spanish HTML Codes

In the HTML markup, place these special character codes where you want the Spanish character to appear. These are used similarly to other HTML special character codes that allow you to add characters that are not found on keyboards and therefore cannot be typed into the HTML to display on a web page.

These characters codes may be used on an English-language website if you need to display words such as piñata and piña colada. They also work in HTML that displays full Spanish translations, whether you code those web pages by hand and have a full Spanish version of the site or you use an automated approach to multilingual web pages and go with a solution such as Google Translate. 

Format
mla apa chicago
Your Citation
Girard, Jeremy. "HTML Codes for Spanish Language Characters." ThoughtCo, Sep. 30, 2021, thoughtco.com/html-codes-spanish-characters-4062194. Girard, Jeremy. (2021, September 30). HTML Codes for Spanish Language Characters. Retrieved from https://www.thoughtco.com/html-codes-spanish-characters-4062194 Girard, Jeremy. "HTML Codes for Spanish Language Characters." ThoughtCo. https://www.thoughtco.com/html-codes-spanish-characters-4062194 (accessed March 19, 2024).