# HTML-entitetskodning

> Escap < > & og anførselstegn, så de kan bruges sikkert i HTML, eller dekod entiteter som &amp; og &#39; tilbage til tekst. Valgfrie numeriske entiteter. Gratis.

Free tool by Orkosi. Page: https://orkosi.com/tools/html-entity-encoder?lang=da

Vis kode på en webside uden at få browseren til at køre den, eller læs tekst, der ankom fyldt med &amp; og &#39;. Kod og afkod ét sted.

1. Indsæt teksten eller HTML-koden.
2. Vælg Kod eller Afkod.
3. Tryk på Konvertér, og kopiér resultatet.

## Input

| Field | Type | Required | What it is |
| --- | --- | --- | --- |
| `text` | text | yes | Tekst eller HTML. |
| `mode` | "encode" \| "decode" | no | Handling. Default: "encode". |
| `non_ascii` | true \| false | no | Kod også accenter og symboler. Default: false. |

## Example

Input:

```json
{
  "text": "<a href=\"/pricing\">Plans & pricing</a>",
  "mode": "encode"
}
```

Result:

```json
{
  "output": "&lt;a href=&quot;/pricing&quot;&gt;Plans &amp; pricing&lt;/a&gt;"
}
```

## Run it

It needs a free Orkosi account, nothing else. No credits are used.

- **A person**: open the page, enter an e-mail once, use the tool.
- **Claude or ChatGPT**: add the Orkosi connector `https://orkosi.com/api/v1/public/mcp` and sign in, or create the free account on the sign-in page. Then call `orkosi_run_free_tool` with `{ "tool": "html-entity-encoder", "input": { … } }`.
- **Any agent or program that can make an HTTP request**:

  1. Once, create the account: `POST https://orkosi.com/api/v1/public/signup` with `{ "name": "…", "email": "…", "terms_accepted": true }` and no key. Ask the person for the e-mail and their agreement to the terms first. The answer carries `data.api_key`, shown once.
  2. Run the tool:

```bash
curl -X POST https://orkosi.com/api/v1/public/tools/html-entity-encoder/run \
  -H "Authorization: Bearer $ORKOSI_API_KEY" -H "Content-Type: application/json" \
  -d '{"input":{"text":"<a href=\"/pricing\">Plans & pricing</a>","mode":"encode"}}'
```

The answer is `{ "data": { "tool": "…", "result": { … } } }`. A call without a key is answered 401 with the signup steps as data.

## Questions

**Hvilke tegn skal escapes i HTML?**

Ampersand, mindre-end- og større-end-tegn samt, i attributter, dobbelte og enkelte anførselstegn. Det er de fem tegn, dette værktøj koder.

**Hvornår bør jeg kode tegn, der ikke er ASCII?**

Kun når siden eller e-mailsystemet ikke bruger UTF-8. Så er accenter og symboler mere sikre som numeriske entiteter som &#233;.

**Understøtter afkodning navngivne entiteter?**

De almindelige (amp, lt, gt, quot, apos, nbsp, copy, reg, trade, euro, pound, hellip, tankestregerne og vinkelanførselstegnene) samt alle numeriske entiteter.

All free tools: https://orkosi.com/tools.md
