HTML Tutorial 0/139 lessons ~6 min read Lesson 36

    HTML Symbols

    html symbols html symbols represent currency, math, and special characters in documents. prod html symbols — currency (£ € ¥),

    Course progress0%
    Focus
    18 guided sections
    Practice signal
    Examples included
    Career prep
    Interview Q&A included

    Introduction

    HTML symbols — currency (£ € ¥), math (∑ ≠ ±), arrows (→), and dingbats (✓ ★) — can be authored as Unicode UTF-8 characters or named/numeric entities. Google Finance and Amazon price displays use real currency symbols with UTF-8; legal pages use © and ™ consistently. Staff engineers prefer literal Unicode in UTF-8 sources over entity soup when fonts support glyphs.

    Business problem

    Wrong symbol encoding shows � replacement characters, question marks in boxes, or HTML entity text literally on screen — trust erosion on checkout currency display. Copy-paste from Word introduces vendor-specific symbols breaking in web fonts.

    • Revenue: £ displayed as ? — UK users abandon checkout.
    • Legal: Missing ® on trademark statements — compliance gaps.
    • Accessibility: Decorative star symbols read aloud redundantly by screen readers.

    Why this feature exists

    Web documents exchange symbols beyond ASCII — HTML entity catalogs and UTF-8 encoding enable portable representation without images of text. Math and science publishing drove numeric entity support.

    • Named entities: €, £, ×, ÷ — mnemonic.
    • Unicode: Modern default — one encoding for all scripts and symbols.
    • Fonts: Symbol glyph depends on font stack — fallback chains matter.

    Browser internals

    Parser resolves entities to Unicode code points in DOM. Rendering uses font matching — symbol blocks in system fonts cover common currency; rare math symbols need specialist fonts (STIX, Cambria Math).

    • Combining: Accents via combining characters vs precomposed — NFC normalization in search.
    • BiDi: Currency symbol position with RTL — HTML symbol + bidi algorithm.
    • Variation selectors: Emoji-like symbols may have VS variants.
    text
    £ → U+00A3 → glyph from font
    Literal £ in UTF-8 file → same DOM result if charset correct
    Missing font glyph → .notdef or fallback font

    Rendering workflow

    Icon fonts misused for symbols fail when font blocked or FOIT — prefer Unicode character or SVG with text fallback. Stripe amounts use tabular nums font-feature-settings in CSS on UTF-8 digits and currency symbol.

    • CLS: Icon font swap changes symbol width — price column jumps.
    • Print: Currency symbols must print — not CSS background-image icons.
    • PDF: HTML to PDF engines embed fonts for symbol coverage.

    Feature deep dive

    Symbol guidelines: Currency with ISO context in text; use × for multiplication sign vs letter x; minus − vs hyphen -; checkmark ✓ with accessible text nearby; avoid icon font for single-character symbols when Unicode suffices.

    • Math: Complex equations — consider MathML or SVG, not entity chains.
    • Arrows: → in UI — ensure not only color cue; pair with text.
    • Stars: Rating ★★★★☆ — expose rating value in text for AT.
    html
    <p>Price: <span class="price">&pound;49.99</span> <small>inc. VAT</small></p>
    <p>Dimensions: 10 &times; 20 &times; 5 cm</p>
    <p>Rating: <span aria-hidden="true">&#9733;&#9733;&#9733;&#9734;&#9734;</span>
    <span class="visually-hidden">3 out of 5 stars</span></p>

    Accessibility analysis

    Screen readers announce some symbols literally ("pound sign", "star") — provide visually hidden text for ratings and critical symbols. Decorative flourishes aria-hidden. Currency amount should be read as whole phrase "49 pounds 99".

    • WCAG 1.1.1: Information in symbols needs text alternative if not decorative.
    • Contrast: Symbol color must meet contrast — not color-only status checkmark.
    • Zoom: Unicode symbols scale with text — icon fonts may not.

    SEO impact

    Symbols in titles and snippets — ™ ® © display in SERPs if properly encoded — brand signals. Keyword stuffing with star characters penalized as quality issue. Price symbols in structured data Offer priceCurrency ISO code — not symbol alone.

    • Schema: price: "49.99", priceCurrency: "GBP" — symbol in visible HTML optional.
    • Crawl: Replacement character � in title — encoding bug hurts CTR.
    • i18n: hreflang pages use locale-appropriate currency display.

    Security considerations

    Homoglyph attacks — Cyrillic 'а' mimicking Latin 'a' in URLs and text — symbol confusion phishing. Punycode domain display symbols. User-supplied symbols in reviews — still encode HTML metacharacters even if Unicode allowed.

    • IDN: Browser shows Unicode domain — homograph warnings.
    • Sanitize: Allowlist Unicode ranges in UGC — block bidi override chars.
    • Log injection: Symbol newlines in logs — separate from HTML concern.

    Performance impact

    Unicode symbols are 1-4 UTF-8 bytes each — negligible vs icon font 50KB download. Amazon uses system font symbols for currency on mobile web — zero extra font request.

    • Font subsetting: If custom font, subset currency symbols used.
    • SVG icons: Inline SVG star vs Unicode — SVG heavier per instance unless sprite.
    • Entity length: £ vs £ — minor byte difference compressed.

    Real production example

    BBC weather and finance pages — degree symbol °, wind arrows, currency in UTF-8 with documented font stacks ensuring glyph coverage on all platforms.

    • Stripe: formatMoney in JS for display; HTML SSR uses locale-aware Intl output.
    • Shopify: money filters output locale currency — underlying Unicode symbol.
    • Testing: Visual snapshot on Windows/Android for symbol rendering.
    html
    <span class="amount" data-currency="GBP">&pound;1,234.56</span>
    <!-- Structured data uses ISO -->
    <script type="application/ld+json">
    {"@type":"Offer","price":"1234.56","priceCurrency":"GBP"}
    </script>

    Enterprise usage

    Design tokens document approved symbols for degrees, trademarks, multiplication — not ad-hoc Word paste. Localization team maintains symbol glossary per market (decimal comma vs period separate from symbol).

    • CMS: Symbol picker inserts Unicode not images.
    • Legal review: ® usage on product names in HTML templates.
    • Accessibility: Rating component pattern in design system docs.

    Common production failures

    Latin-1 mislabeled as UTF-8 — Euro symbol became € across 12 European locales — week-long encoding pipeline fix at retailer.

    • Icon font: Square boxes instead of stars on Android — ratings useless; switched to Unicode + hidden text.
    • PDF invoice: Missing £ in embedded font — customer support flood.
    • SEO: Title with broken symbol encoding — CTR drop in UK market.

    Architecture review questions

    • Are currency symbols correct for locale and encoded in UTF-8?
    • Do rating or status symbols have accessible text equivalents?
    • Are decorative symbols marked aria-hidden?
    • Does structured data use ISO currency codes not symbols alone?
    • Do fonts in stack cover symbols used on Windows and Android?
    • Are homoglyph and bidi override characters blocked in UGC?

    Hands-on project

    Build a price and rating component in HTML with UTF-8 currency, accessible star rating, JSON-LD Offer, and visual regression across platforms for symbol glyphs.

    • Deliverable: Three locale variants GBP/EUR/USD.
    • Verify: NVDA reads rating as "3 out of 5 stars".
    • Stretch: Document symbol glossary for content team.

    Interview questions

    Unicode literal vs HTML entity for currency symbols in production templates?(Advanced)

    With UTF-8 everywhere (DB, API, HTML charset), literal £ € is fine and readable in source. Entities useful in ASCII-only pipelines or code samples showing entities. Critical: charset consistency end-to-end. Structured data still uses ISO 4217 codes.

    Follow-up: Tabular numbers for prices?

    Accessible pattern for star rating display in HTML?(Advanced)

    Visible stars may be Unicode or SVG with aria-hidden=true; adjacent or visually-hidden text '4 out of 5 stars'; optionally schema AggregateRating. Don't rely on color-filled stars alone. Test SR announcement. Amazon pattern mixes visible stars with count link text.

    Follow-up: Half-star symbols?

    Homoglyph and bidi override risks in user-generated product reviews?(Advanced)

    Attackers use lookalike Unicode or bidi override to spoof brand names or hide malicious URLs. Mitigate: allowlist scripts, NFC normalization, strip bidi controls, punycode display warnings for links, encode HTML metacharacters. Amazon and Stripe UGC pipelines include Unicode normalization steps.

    Follow-up: What is WCAG guidance on Unicode?

    Try it yourself

    Edit the HTML, CSS, or JS panels — the preview updates as you type.

    Try it yourself

    Preview

    Summary

    HTML symbols represent currency, math, and special characters in documents. Production teams at BBC and Amazon validate encoding pipelines and accessible alternatives — broken symbols erode trust on money and rating surfaces faster than almost any other markup bug.

    Ready to mark this lesson complete?Track your journey across the entire course.