GUIDE深度 · Deep dive

Named vs Numeric Entities

Named entities (&) are readable; numeric entities (& or &) are more universal. HTML5 supports many named entities; XML supports only a few predefined ones, so numeric entities are common across XML.

更新 2026-10-31 · 公式可核验

Three forms

Named: &, <, ".

Decimal: &, <.

Hex: &, <.

Choosing

Named entities are more readable in HTML; numeric entities are safer in XML and cross-system data.

Numeric entities work for Chinese, but direct UTF-8 is clearer.

FAQ

Are & and & the same?

They display the same, but a literal & in source must be & to be valid.

Do numeric entities need a semicolon?

Yes; omitting it can misparse.

Sources

Related calculators

HTML Entity Encoder/DecoderEscape &<>"' into HTML entities or decode entities back, with optional numeric entities for non-ASCII.

More guides

HTML Escaping and XSSRead guide