IRI Encoder (RFC 3987)

Percent-encode an IRI to URI, preserving Unicode path chars

Convert an Internationalized Resource Identifier (IRI) to a plain URI by percent-encoding every character outside the ASCII URI set as UTF-8 bytes, per RFC 3987. ASCII URL structure is preserved. Runs in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is an IRI?

An Internationalized Resource Identifier, defined in RFC 3987, is a URI that may contain Unicode characters directly — for example a path with Cyrillic or Chinese text. IRIs are easier for people to read, but many systems still require a plain ASCII URI.

An IRI (Internationalized Resource Identifier, RFC 3987) is a URL that may contain Unicode — handy for humans but not always accepted by strict clients. This tool converts an IRI to a plain ASCII URI by percent-encoding the non-ASCII parts, in your browser.

Why IRIs and URIs are different

RFC 3986 defines a URI as a strictly ASCII string. RFC 3987 then extends that to define an IRI, which allows Unicode characters such as Arabic letters, Chinese characters, accented vowels, and Cyrillic script to appear directly in the path, query string, and fragment. Browsers display IRIs as readable text, but under the hood they must transmit the ASCII percent-encoded URI form. Many HTTP clients, server logs, and older systems still only accept ASCII, which is where an explicit IRI-to-URI converter becomes useful.

How it works

The conversion walks the IRI character by character:

  1. Characters in the allowed ASCII set — unreserved (A-Z a-z 0-9 - . _ ~) and reserved delimiters (: / ? # [ ] @ ! $ & ' ( ) * + , ; = and %) — are left as-is so the URL structure stays intact.
  2. Every other character (any non-ASCII, plus ASCII space and control characters) is encoded to its UTF-8 bytes, and each byte becomes %XX.

This is exactly the IRI-to-URI mapping from RFC 3987: it preserves the scheme, host separators, and query structure while making the identifier safe for systems that only accept ASCII URIs.

Worked encoding examples

IRI:  https://example.com/café?q=naïve
URI:  https://example.com/caf%C3%A9?q=na%C3%AFve

IRI:  https://zh.example.com/北京/天气
URI:  https://zh.example.com/%E5%8C%97%E4%BA%AC/%E5%A4%A9%E6%B0%94

IRI:  https://de.example.com/Straße?sort=asc
URI:  https://de.example.com/Stra%C3%9Fe?sort=asc

In each case the scheme (https://), slashes, query-string delimiters (?, =), and path separators are left intact. Only the non-ASCII characters are encoded, using their UTF-8 byte sequences.

What this tool does not handle: internationalized domain names

The host portion of a URL (the domain name) uses a completely different scheme called Punycode / IDNA. A domain like münchen.de becomes xn--mnchen-3ya.de via IDNA encoding, not via percent-encoding. This tool focuses on the path, query, and fragment, which is where percent-encoding applies per RFC 3987. If you need to encode an internationalized domain, use a dedicated IDNA converter.

When you need this

  • Generating canonical link href values in HTML when a path contains non-ASCII characters.
  • Constructing HTTP request lines for servers that reject non-ASCII input.
  • Storing resource identifiers in systems (databases, XML, CSV) that expect ASCII-safe strings.
  • Debugging encoding mismatches where a Unicode URL produces 400 or 404 errors from a strict HTTP client.
  • Converting Wikipedia article IRIs to the URI form used in API requests (Wikipedia article titles often contain non-ASCII characters).

How browsers handle IRI encoding automatically

Modern browsers perform IRI-to-URI conversion silently when you type or paste a URL into the address bar. The browser displays the human-readable IRI (with the Unicode characters visible) but sends the percent-encoded URI over the network. This automatic conversion is convenient for browsing but can create ambiguity when you need the exact encoded form — for example, when pasting a URL into an API call, a shell script, or a database field. This tool makes the conversion explicit and verifiable.

Everything runs in your browser. Nothing you type is uploaded.