# Idna domain to ascii

`idna-domain-to-ascii` · version 1.0.0 · URLs & IP addresses · free, no key needed

Convert a domain to DNS ASCII with UTS #46 ToASCII, STD3, and DNS lengths.

**Use when you need to: convert internationalized domain to ascii · uts 46 toascii · unicode hostname to a-label.**

## Decide before calling

Read the [versioned contract](/v1/tools/idna-domain-to-ascii/versions/1.0.0) and the supported scope below. Reuse `idna-domain-to-ascii@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `idna-domain-to-ascii@1.0.0` for convert internationalized domain to ascii. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- convert internationalized domain to ascii
- uts 46 toascii
- unicode hostname to a-label
- punycode a domain name
- dns ascii form of an idn
- transitional idna to ascii
- make a domain safe for dns
- idna toascii with std3 rules

## Not supported

- resolve the domain in dns
- parse a full url with a path
- check bidi or joiner context

## Behavior

- Map each code point by Unicode 17.0.0 IdnaMappingTable status. Ignored code points are removed. Disallowed and valid code points stay. Deviation code points use the table mapping only when transitional is true; otherwise they stay. Mapped code points use the table mapping, except U+1E9E CAPITAL SHARP S, which becomes U+0073 U+0073 (ss) when transitional is true and U+00DF when transitional is false (UTS #46 revision 33, section 4 step 1).
- After mapping, normalize with NFC. The host String.normalize and the Mark category check follow the runtime Unicode version; status values come only from the vendored Unicode 17.0.0 table.
- transitional is optional. When the field is omitted, transitional processing is false and the output echoes false. data_version is unicode-17.0.0-uts46-rev33.
- CheckBidi and CheckJoiners are not applied. NV8 and XV8 markers are not an extra rejection. There is no DNS lookup and no URL parse.
- Disclaimer: format transform only; provides no confidentiality, integrity, or authenticity.
- ToASCII (section 4.2): validate each label with CheckHyphens and UseSTD3ASCIIRules, decode an xn-- label and validate it under nontransitional rules, then punycode any remaining non-ASCII label. Punycode is not remapped.
- VerifyDnsLength: each label is 1 to 63 octets and the domain, excluding a trailing root dot, is 1 to 253 octets. A trailing root dot is preserved and excluded from the domain-octet count; other empty labels are rejected.
- The first failure wins: not_nfc, hyphen, combining_mark, disallowed, std3, punycode, empty_label, then domain_too_long or label_too_long. The last two are limit_exceeded. Earlier failures are invalid_input. details.reason is that code.
- Input longer than 253 UTF-16 code units, or whose UTF-8 form exceeds 253 bytes, is limit_exceeded before mapping and before the lone-surrogate check.

## Input

- `domain` (string, required): min length 1; Domain name, without a scheme or path. Omitted transitional means false.
- `transitional` (boolean, optional): UTS #46 Transitional_Processing. Omission means false.

## Output

- `transitional` (boolean, required)
- `data_version` (constant "unicode-17.0.0-uts46-rev33", required)
- `ascii` (string, required): min length 1; max length 253

## Limits

- max input bytes: 253
- max domain octets: 253
- max label octets: 63

## Example

Request input:

```json
{
  "domain": "faß.de",
  "transitional": true
}
```

Response:

```json
{
  "result": {
    "ascii": "fass.de",
    "transitional": true,
    "data_version": "unicode-17.0.0-uts46-rev33"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "idna-domain-to-ascii",
  "version": "1.0.0",
  "input": {
    "domain": "faß.de",
    "transitional": true
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/idna-domain-to-ascii/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"domain":"faß.de","transitional":true}'
```

The machine-readable contract is at [/v1/tools/idna-domain-to-ascii/versions/1.0.0](/v1/tools/idna-domain-to-ascii/versions/1.0.0).

### CLI

```sh
node cli.mjs run idna-domain-to-ascii 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Idna domain to unicode](/tools/idna-domain-to-unicode): Convert a domain to Unicode with UTS #46 ToUnicode and decode A-labels.
- [Idna domain map](/tools/idna-domain-map): Map a domain with the Unicode 17 UTS #46 table, steps 1 and 2 only.
- [Idna domain diagnose](/tools/idna-domain-diagnose): Validate each dot-separated IDNA2008 label and the 253-octet DNS wire length.
- [Idna label validate](/tools/idna-label-validate): Validate one already-mapped IDNA2008 label for registration or lookup.
- [IPv4 mask convert](/tools/ipv4-mask-convert): Convert between an IPv4 prefix length, dotted subnet netmask, and dotted wildcard (host) mask.
- [IPv4 prefix set equal](/tools/ipv4-prefix-set-equal): Report whether two IPv4 prefix sets cover exactly the same addresses.
