idna
Internationalized Domain Names in Applications (IDNA)
Decision gist · record as of 2026-08-14
Yes. idna is a foundational library (top 100 on PyPI, 1.7+ billion monthly downloads) with no dependencies, active maintenance, permissive licensing, and zero known vulnerabilities. Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively. The only caveat is that emoji domains are not supported by design—IDNA prohibits them and they pose security risks.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with no runtime dependencies.
- Actively maintained with a recent release; last commit 2026-08-08.
- Supports Python 3.9 and higher across CPython and PyPy implementations.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause permissive license allows commercial and private use with minimal restrictions—suitable for most projects.
last release 2026-06-02 (73 days) · last repo commit 2026-08-08 · 290 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,760,742,555 downloads/mo, #6 on PyPI
Alternatives
Verify before relying
pip install idna
import idna
# Encode Unicode domain to ASCII-compatible form
idna.encode('ドメイン.テスト')
# b'xn--eckwd4c7c.xn--zckzah'
# Decode ASCII form back to Unicode
idna.decode('xn--eckwd4c7c.xn--zckzah')
# 'ドメイン.テスト'- Whether the library is used as a transitive dependency by major HTTP clients (requests, urllib3) or if direct adoption is required
- Performance characteristics when processing large batches of domain names
What it is and what it does
idna is a Python library that converts internationalized domain names (IDNs)—domain names containing non-ASCII characters—between their human-readable Unicode form and their ASCII-compatible Punycode representation (xn-- prefixed). It implements the IDNA 2008 standard and Unicode Technical Standard 46 (UTS #46), superseding the standard library's outdated 2003-only implementation. The library validates domains against known security vulnerabilities and supports a broader range of scripts and character sets.
Typical usage involves calling `encode()` to convert a Unicode domain name to its ASCII form for DNS lookups, or `decode()` to convert Punycode back to human-readable Unicode for display. The library also provides per-label functions (`alabel`, `ulabel`) for specialized cases and a command-line tool for batch conversions. It raises specific exceptions (IDNABidiError, InvalidCodepoint, InvalidCodepointContext) for different validation failures, and supports UTS #46 compatibility mapping to normalize user input before conversion.
Use it for
- Convert user-entered domain names to ASCII form before DNS resolution or HTTP requests
- Display internationalized domain names in user interfaces by decoding Punycode representations
- Validate domain names for security issues (bidirectional text attacks, disallowed codepoints) before accepting them
- Normalize domain input from different sources using UTS #46 mapping before IDNA processing
- Batch-convert domain names via the command-line tool for data migration or validation workflows
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
idna is a foundational library (top 100 on PyPI, 1.7+ billion monthly downloads) with no dependencies, active maintenance, permissive licensing, and zero known vulnerabilities. Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively. The only caveat is that emoji domains are not supported by design—IDNA prohibits them and they pose security risks.
Install
idna on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained with a recent release; last commit 2026-08-08. Supports Python 3.9 and higher across CPython and PyPy implementations.
License in practice
BSD-3-Clause permissive license allows commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install idna
import idna
# Encode Unicode domain to ASCII-compatible form
idna.encode('ドメイン.テスト')
# b'xn--eckwd4c7c.xn--zckzah'
# Decode ASCII form back to Unicode
idna.decode('xn--eckwd4c7c.xn--zckzah')
# 'ドメイン.テスト'
Verify before relying
- Whether the library is used as a transitive dependency by major HTTP clients (requests, urllib3) or if direct adoption is required
- Performance characteristics when processing large batches of domain names
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 73 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,760,742,555 / month, #6 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: System AdministratorsOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Internet :: Name Service (DNS)Topic :: Software Development :: Libraries :: Python ModulesTopic :: Utilities |
Evidence: idna-3.18-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “punycode encoding decoding”
- idnaConverts domain names between Unicode and ASCII-compatible encoding…
- domain2idnaConverts domain names and URLs to Punycode/IDNA format, with support…
- urlpyurlpy parses, normalizes, and compares URLs with support for…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
Determines platform-specific directories for application data, config, cache, logs, and user media folders across macOS, Windows, Linux, and Android.
See also domain2idna · idna_ssl · apeye-core · publicsuffixlist · emoji-country-flag · dnstwist · publicsuffix2 · anyascii · zalgolib · linkify-it-py