Web & Code

O With Accent In HTML: Entities And Encoding

How to write accented O in HTML with named and numeric entities, and why UTF-8 lets you paste the character directly.

Apr 14, 2026 8 min read
HTML source code showing an O acute entity

Putting an accented O into a web page used to require careful use of HTML entities. Today, thanks to UTF-8, you can often paste the character directly. This guide covers both routes, explains named and numeric entities, and shows how to avoid the encoding problems that turn Ó into garbled text.

The Simplest Route: Paste It

If your page is served as UTF-8, which is the modern default, you can type or paste an accented O straight into your HTML and it will display correctly. No entity is needed. This is the recommended approach for almost all new work, because it keeps the source readable and avoids a layer of encoding.

To make sure a page is UTF-8, include the character set declaration in the document head and save the file itself as UTF-8 in your editor. With both in place, accented characters simply work.

The single most important line for accented text on the web is the UTF-8 charset declaration in the head. Get that right and most encoding problems never appear.

Named Entities

HTML also provides named entities for the common accented letters, which are readable codes standing in for the character. The named entities for the accented O family are straightforward:

CharacterNamed entity
ÓÓ
óó
ÒÒ
ÔÔ
ÕÕ
ÖÖ
ØØ

Named entities are useful when you want the source to stay pure ASCII, or when you are unsure of the page encoding. Not every accented O has a named entity, though; the rarer marks need the numeric form.

Numeric Entities

Every Unicode character has a numeric entity, written as an ampersand, a hash, the decimal code point and a semicolon. For Ó that is Ó, and for the macron Ō it is Ō. There is also a hexadecimal form using an x before the number. Numeric entities cover the entire Unicode range, so they work for characters that have no named entity.

The finder on this site gives you the entity for each character with its HTML button, so you can copy the exact code without looking it up.

Avoiding Broken Output

The classic failure is text saved as UTF-8 but served or read as a legacy encoding, which turns each accented character into two odd symbols. The fix is consistency: save as UTF-8, declare UTF-8, and serve as UTF-8. When all three agree, the character renders correctly and you can use the raw glyph freely. Our troubleshooting guide covers the details.

In Summary

On a UTF-8 page you can paste an accented O directly, which is the cleanest approach. Use named entities like Ó when you want ASCII source, and numeric entities like Ó for characters without a name. Keep encoding consistent across saving, declaring and serving, and the mark will always display.

More Reading

Keep Exploring