Skip to content
All tools
English

Hex, binary, Unicode and Punycode

See the real UTF-8 bytes behind any text, and convert Arabic domain names to the xn-- form DNS uses.

Your files never leave your device
Direction
Format

Type or paste text. The result updates as you type.

Options

How to use it

  1. Pick a format

    Hex, binary, Unicode escapes, or Punycode for domain names.

  2. Choose a direction

    Encode turns text into the format; Decode reads it back.

  3. Copy the result

    For hex, choose the separator your code or tool expects.

Text is bytes

Computers store text as numbers. In UTF-8, English letters take one byte each, Arabic letters two, and most emoji four. The hex view shows those bytes in base 16, two digits per byte; binary shows the same bytes as eight 0s and 1s. The letter A is 41 in hex and 01000001 in binary; the Arabic letter ب is d8 a8.

Unicode escapes

JSON, JavaScript, Java and Python can write any character as \uXXXX, the code point in hex. Characters outside the Basic Multilingual Plane, like most emoji, need two escapes (a surrogate pair) or the newer \u{1F44B} form. If an API response shows \u0645\u0631\u062D\u0628\u0627 instead of Arabic, decode it here.

Punycode and Arabic domain names

DNS only understands ASCII, so internationalised domain names (IDNs) are stored in Punycode (RFC 3492) with an xn-- prefix on each non-ASCII label. مثال.com is really xn--mgbh0fb.com. You need the xn-- form when you set up DNS records, TLS certificates, server configs or email. Our converter matches the URL parser built into browsers.

Punycode is also how lookalike "homograph" phishing domains are exposed: if a link that looks like a familiar brand turns into xn--…, it contains letters from another script. More tools: URL decoder, Base64, auto-detect.

Frequently asked questions

Why does one Arabic letter become two hex bytes?
UTF-8 uses two bytes for every character from U+0080 to U+07FF, which includes the whole basic Arabic block.
Can I register an Arabic .com domain?
Yes. Registrars accept IDNs under .com and show the Punycode form too. Arabic country domains such as .مصر and .السعودية also exist.
My hex will not decode. Why?
Either it has an odd number of digits, contains letters beyond f, or the bytes are not valid UTF-8 (for example, a file or an old Windows code page).