ForHosting KIT · Developer Utilities

HTML named to numeric entities

Switch HTML entities between names and numbers: © becomes © and — becomes —, so markup passes through XML parsers and email gateways that do not know every name, and back again when you want readable source. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Text
Copyright © 2024 — all rights reserved
Calculation mode
To numeric
You get
Result
Copyright © 2024 — all rights reserved
Converted
2
Encoding
entity_named_to_numeric
Input length
49

HTML authors and pipeline engineers often need the same character written two different ways: a named entity such as © or —, or a numeric character reference such as © or —. Named forms are readable in source; numeric forms travel better through XML parsers, email clients, and strict processors that do not ship a full HTML named-entity table. This capability rewrites named HTML entities into their equivalent decimal numeric character references, and rewrites numeric references back into preferred named forms when the code point is known. The path is fully deterministic: the same text and mode always yield the same result, with no network calls, no random salts, and no date-dependent shortcuts.

Named entities versus numeric character references

A named HTML entity is a mnemonic escape such as © for the copyright sign or — for the em dash. A numeric character reference encodes the same Unicode scalar as a decimal form © or a hexadecimal form ©. Both are valid in HTML; numeric forms are required in some XML dialects and are preferred when the consumer might not know every HTML5 name.

This tool does not encode raw plain text into entities and does not decode entities into visible glyphs for display—that is a different job served by the general HTML entities encoder. Here the contract is strictly format conversion between named and numeric references that already appear in the string. Hex input is accepted; successful numeric output always uses decimal form so goldens and diffs stay byte-stable.

Bare ampersands that do not form a complete entity ending with a semicolon are left untouched, which keeps incomplete drafts from exploding while still catching complete but unknown names such as &notanentity;.

Where named-to-numeric conversion earns its keep

Email HTML pipelines often start from CMS content full of  , ’, and — and must ship through gateways that only guarantee numeric references. XML serializers and SVG embedders similarly prefer &#N; over names that are not part of XML 1.0. Quality engineers pin both directions in contract tests so a middleware cannot silently change how & or € is emitted between releases.

Localization and accessibility teams use the same conversion when auditing that copyright, trademark, and punctuation entities remain consistent across templates. Educators demonstrate the difference between named entities, decimal references, and hex references with a single deterministic oracle. Pair this landing with the general HTML entities encoder when you need to escape raw ampersands and angle brackets from plain text, and with Unicode code-point tools when you need U+XXXX tokens instead of HTML references.

Distinct search intent, same pure-parse reliability as the rest of the tier-A encoding catalog.

Email and XML entity normalization

Rewrite CMS named entities such as © and — into decimal numeric references before sending HTML through strict email or XML processors.

Editor-friendly numeric cleanup

Convert legacy © and — dumps back into readable named entities for human editors and template reviews.

What is the difference between this tool and a general HTML entities encoder?

A general encoder turns plain special characters into entities and decodes entities back to glyphs. This tool only rewrites named references into numeric ones (and reverse) without changing non-entity text into escapes.

Why convert named entities into numeric references?

Numeric references travel better. XML parsers, some email clients and strict processors do not carry the full table of HTML names, and some XML dialects require numbers, while © is understood everywhere as the copyright sign.

What happens if an entity name is unknown?

The conversion stops and names the unknown entity, for example &notanentity;, so a typo never stays hidden in finished markup. Fix or remove that entity and run the conversion again.

Are hexadecimal references like © accepted?

Yes, as input. When turning numbers into names, © becomes © just like © does. When the result is numeric, it is always written in decimal so that output stays identical between runs.

What happens to an ampersand that is not part of an entity?

It is left exactly as it is. Only complete entities that end with a semicolon are converted, so a loose ampersand in a draft does not break the rest of the text.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/enc/entity-named-to-numeric

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/enc/entity-named-to-numeric \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Copyright © 2024 — all rights reserved"}'
{
  "text": "Copyright © 2024 — all rights reserved"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "enc.entity_named_to_numeric",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Unknown names are reported with an invalid_input error so typos never silently remain in production markup.

Named entities versus numeric character references

On mode to_numeric every well-formed &name; is looked up in a fixed map of common XML, HTML4, and widely used HTML5 names and rewritten as a stable decimal &#N; token. On mode to_named every well-formed &#N; or &#xH; is mapped back to the preferred name when that code point is registered, so — becomes — and © becomes ©.

Input contract, modes, and how unknown names are reported

POST a JSON body with a required string field text that holds the fragment to convert. Aliases input, value, s, and html are accepted so forms and SDK clients can reuse existing field names. Mode defaults to to_numeric and may be set to to_named; aliases op, direction, and action map to the same switch. Surrogate code points and values outside the Unicode scalar range raise invalid_input rather than emitting broken UTF-16. The success payload always includes result, mode, encoding fixed to entity_named_to_numeric, converted as the count of references rewritten, input_length, output_length, and unknown_names as an empty array on success. There is no network, no Date, and no randomness, so the free browser path and the priced API path return identical JSON for the same input. Failed validation is not billed; successful calls cost the published $0.002 base price per item.

Where named-to-numeric conversion earns its keep

Content migrations that reverse the problem—legacy decimal dumps that editors want to read as named entities—use mode to_named so humans can edit © instead of ©. On this page the work runs entirely in your browser; through the API each successful conversion costs $0.002, invalid input is not charged, and nothing is stored after the response returns.

CI fixtures for entity form

Generate deterministic named-to-numeric and numeric-to-named pairs so middleware cannot change entity style between releases.

How do I convert © and — to numeric form?

Send text containing those named entities with mode to_numeric (the default). The API returns decimal references such as © and — plus a converted count.

What happens if a named entity is unknown?

The task fails with invalid_input and the message lists the unknown name(s). Nothing is rewritten and the call is not billed.

Can I convert numeric entities back to names?

Yes. Set mode to_named. Known code points become preferred names such as ©; unmapped code points stay as decimal numeric references and are counted in unmapped_numeric when present.

What does HTML named-to-numeric conversion cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →