Named HTML entities encoder and decoder
A & B © becomes A & B ©: every character with a standard name, from angle brackets to the trademark sign, is written by that name. Decoding turns <span> back into angle brackets and rejects names it does not know. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Text
- Price < $5 & free shipping © 2026
- Calculation mode
- Encode
- Result
- Price < $5 & free shipping © 2026
- Encoding
- html_entities_named
- Input length
- 33
- Output length
- 45
This named HTML entities tool converts ordinary Unicode characters into standard named character references and decodes those names back into plain text. Encoding rewrites every character that has a defined name in the fixed entity table—ampersand becomes &, less-than becomes <, copyright becomes ©, non-breaking space becomes —so markup stays readable and portable without inventing numeric code points. Decoding accepts only well-formed named forms such as & and ™, and it fails loudly when a name is not in the table so typos never silently survive into production HTML. The path is fully deterministic: the same text and mode always produce the same result, with no network calls, no random salts, and no date-dependent shortcuts. Small checks include encoding A & B © into A & B © and decoding <span> back to angle brackets.
What named HTML entities are and what this tool returns
Named HTML entities are textual escapes that stand in for characters using a mnemonic name rather than a numeric code point. An ampersand starts a character reference, so raw & in body text must become & if you intend a literal ampersand rather than the start of another entity. Angle brackets open and close tags, so < and > become < and > when you want those glyphs as data rather than markup structure.
Beyond the five XML specials, the HTML named table also covers typography and symbols people search for by name: non-breaking space as , copyright as ©, registered as ®, trademark as ™, euro as €, en dash as –, and many Latin-1 and Greek letters. This landing implements encode over the full reverse map of that fixed standard table and decode of well-formed &name; sequences only. Numeric forms such as ' or   are left unchanged on purpose—this capability answers the named-entity search intent, not the general numeric reference path.
Where named HTML entity encode and decode fit in markup workflows
Developers meet named HTML entities when they paste user text into templates, when CMS exports mix raw ampersands with double-escaped fragments, and when email or static generators need portable symbols without embedding brittle numeric code points. Frontend teams decode entity-heavy copy pulled from legacy databases so UI components render true quotes, dashes, non-breaking spaces, and copyright marks instead of literal ’ or © sequences.
Quality engineers generate deterministic encode and decode pairs for contract tests so a middleware that claims named-entity support cannot silently change or & handling between releases. Educators use the same tool when teaching the difference between named entities and decimal or hex references that modern HTML parsers also accept.
What you can do with it
Readable template and attribute text
Encode titles, labels, and snippets so ampersands, angle brackets, copyright, and non-breaking spaces become named entities humans can review in source.
Legacy CMS named-entity cleanup
Decode &, , ©, and other named entities from exported HTML or database fields back into plain Unicode for modern UIs.
FAQ
What do named HTML entities cost?
The tool is free in your browser on this page.
Which characters are encoded?
Encode mode rewrites every character that has a defined name in the standard table—including &, <, >, ", ', ©, ®, non-breaking space, dashes, and common symbols—into &name; form. Unmapped characters stay unchanged.
What happens if a named entity is unknown?
Fix the spelling or use a name defined in the standard table such as & or .
Are numeric entities decoded?
No. This capability is named-only: ' and   are left unchanged. Use a general HTML entities tool if you need numeric references.
Which symbols have a name I can use?
Besides the five special characters, the table covers typography and symbols such as for a non-breaking space, ©, ®, ™, € and –, plus many Latin-1 and Greek letters.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/enc/html-entities-named \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Price < $5 & free shipping © 2026"}'const res = await fetch("https://api.kit.forhosting.com/enc/html-entities-named", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "Price < $5 & free shipping © 2026"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/enc/html-entities-named",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "Price < $5 & free shipping © 2026"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/enc/html-entities-named", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"Price < $5 & free shipping © 2026"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"Price < $5 & free shipping © 2026"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/enc/html-entities-named", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"text": "Price < $5 & free shipping © 2026"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "enc.html_entities_named",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Use it free in the browser for template hygiene and content cleanup, or call the API at $0.002 per successful request when pipelines need reproducible named-entity transforms in CI and backend services.
What named HTML entities are and what this tool returns
The JSON response always includes result for the transformed string, mode echoing encode or decode, encoding fixed to html_entities_named, input_length plus output_length so tests can assert sizes, and either entities_encoded or entities_decoded so you can confirm how many characters or names were rewritten. There is no partial silent skip for unknown names: either every named entity is defined in the map or the request fails with invalid_input.
How text and mode are read and how results stay reproducible
Encode walks the string by Unicode code point and replaces every character that has a preferred name in the reverse table with &name;, leaving letters, digits, and other unmapped Unicode unchanged so readable copy stays readable. When several historical names could map to the same character, encode prefers a stable canonical choice: amp, lt, gt, quot, and apos for the five specials, and the first declared name for other symbols. Decode scans for well-formed named entities that end with a semicolon: a name of a leading letter followed by letters or digits. The preferred payload field is text, with aliases input, value, s, and html so forms, query strings, and SDK clients can reuse the same contract without renaming columns. Mode defaults to encode and accepts decode explicitly; aliases op, direction, and action map to the same switch for scripts that already use those names. Bare ampersands that do not form a complete named entity are left untouched so incomplete drafts do not explode, but a complete unknown name such as ¬anentity; raises invalid_input with a message that names the bad reference. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline without re-implementing entity tables yourself. Invalid inputs return invalid_input and are not charged, which keeps validation cheap while successful transforms remain a fixed item price at $0.002.
Where named HTML entity encode and decode fit in markup workflows
Backend services encode dynamic titles and labels before embedding them in HTML snippets or JSON that later becomes HTML, preferring mnemonic names that humans can audit in source control. On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split—free interactive exploration and a priced, identical API—matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the encoded result. Pair it with HTML sanitize or minify helpers when you need broader markup cleanup, and with other encoding endpoints when you are building a small lab of free, deterministic text tools focused on named references people actually search for.
Integration use cases
Deterministic CI fixtures
Generate reproducible named encode and decode pairs for unit tests, golden files, and contract checks across services.
Technical questions
What modes are supported?
mode=encode (default) turns mapped characters into named entities. mode=decode turns well-formed named entities back into characters.