Are Domain Names Case-Sensitive? Domains, URLs and Email Addresses Compared
Domain names are not case-sensitive: Example.COM, example.com and EXAMPLE.com are the same name, as RFC 4343 confirms for the DNS. In a full web address, the scheme and the host are also case-insensitive, but the rest of the URL, the path, query and fragment, is case-sensitive by default under RFC 3986, so /About and /about can be different pages. In an email address, the domain part is case-insensitive, while RFC 5321 says the local part before the @ may be case-sensitive; in practice, almost all mail providers treat it as case-insensitive, and the same RFC advises against creating mailboxes that rely on case.
The rules at a glance
| Part | Example | Case-sensitive? | Source |
|---|---|---|---|
| Domain name | Shop.Example.org | No (ASCII letters) | RFC 4343 |
| URL scheme | HTTPS:// | No | RFC 3986 |
| URL host | https://Example.org | No | RFC 3986 |
| URL path | /Docs/Page.html | Yes, by default | RFC 3986; behaviour depends on the server |
| Query string | ?Ref=News | Yes, by default | RFC 3986; depends on the application |
| Percent-encoding hex digits | %2f vs %2F | No, but uppercase is preferred | RFC 3986 |
| Email domain part | user@Example.org | No | DNS rules |
| Email local part | Jane.Doe@ | May be, per RFC 5321; rarely in practice | RFC 5321 |
Domain names: insensitive, but case is preserved
The DNS compares ASCII letters without regard to case. RFC 4343 clarifies two details that matter to developers. First, case-insensitivity applies to the ASCII letters A to Z only; other octets in a label are compared exactly. Second, servers are expected to preserve the case they were given where possible, so a name may come back with the capitalisation used when it was entered, even though lookups match regardless. This is why you can write a brand name with capitals in marketing, MyShop.example, and it still resolves.
Internationalised names follow their own path. Before lookup, a Unicode name is converted to an ASCII A-label beginning xn--, and that conversion includes mapping steps that deal with case for many scripts. Our walk-through of a name going from Unicode to xn-- and the thorough guide to internationalised domain names explain those rules. Look-alike characters are a separate risk from case, covered in the evidence on look-alike internationalised names.
URLs: the host is safe, the path is not
RFC 3986, the generic URI syntax, says the scheme and host are case-insensitive and recommends normalising them to lowercase. Everything after the host is case-sensitive unless the scheme or the server defines otherwise. In practice that depends on the web server and the file system behind it:
- Servers on file systems that distinguish case, common on Linux, usually treat
/About.htmland/about.htmlas different files. - Servers on case-insensitive file systems may return the same file for both, which can create duplicate URLs for one page.
- Applications and frameworks can apply their own routing rules, either way.
For site owners, the safe habit is to choose one convention, usually all lowercase paths, link consistently, and redirect alternative capitalisations to the canonical form. That keeps search engines and analytics from treating one page as several. Our page on subdomains versus subfolders covers related URL structure rules.
Email addresses: the local part is the exception
The domain after the @ is a domain name, so it follows DNS rules and is case-insensitive. The local part is different on paper. RFC 5321 says it must be treated as case-sensitive by systems passing the message along, because only the destination server knows what its mailbox names mean. The same section also says a receiving host should avoid defining mailboxes whose local part depends on case, to make mail work reliably.
The result in the real world is that major mail services treat Jane.Doe@example.org and jane.doe@example.org as the same inbox. For an application, the practical advice is:
- Lowercase the domain part when you store or compare addresses.
- Preserve what the user typed in the local part for sending, but compare addresses case-insensitively when checking for duplicate accounts.
- Never rely on case alone to distinguish two accounts.
Length limits for addresses are covered separately in how long an email address can be.
Common mistakes that case causes
- Duplicate accounts. A sign-up system that compares addresses exactly can let one person register as
Jane@example.organdjane@example.org. - Broken links after a move. Moving a site from a case-insensitive server to a case-sensitive one can break every link that used inconsistent capitals.
- Split analytics. The same page reached through two capitalisations can be counted as two pages.
- Over-correcting. Lowercasing a whole URL, path included, can send visitors to a page that does not exist on a case-sensitive server.
Other identifiers worth checking
Several things that look like domain names have their own rules. Hostnames in TLS certificates are matched case-insensitively. DNS record types such as TXT are not case-sensitive in zone files, but the data inside a TXT record is passed back exactly. Underscore labels used by email and service records, such as _dmarc, are still DNS labels and match regardless of case; see underscores, hyphens and the taste of naming.
Frequently asked questions
Does capitalisation in a domain name matter?
No. DNS compares ASCII letters case-insensitively, so any capitalisation of a domain reaches the same name. You can use capitals for readability in print.
Are URLs case-sensitive?
Partly. The scheme and host are not. The path and query are case-sensitive by default, and whether two capitalisations return the same page depends on the server.
Are email addresses case-sensitive?
The domain part is not. The local part may be under RFC 5321, but almost all providers treat it as case-insensitive, and the RFC advises against case-dependent mailboxes.
Find more rules and their sources in the Learn hub.