← Blog · · ConvertCaseHQ Team · 6 min read

Text Case in Domain Names and Emails: Does It Matter?

For domain names, text case never matters: Example.COM and example.com are the same domain. For email addresses it's split. The domain after the @ is case-insensitive, while the local part before it is technically case-sensitive under the email standard, though that same standard discourages relying on it, and Google, for one, keeps its Workspace usernames lowercase. The practical rule: keep what the user typed, but compare addresses case-insensitively.

Domain names are case-insensitive

The Domain Name System has treated names as case-insensitive from the start, and RFC 4343 exists purely to clarify it. Its abstract opens: "Domain Name System (DNS) names are 'case insensitive'." Whether someone types CONVERTCASEHQ.COM, ConvertCaseHQ.com or convertcasehq.com, the lookup finds the same records.

Browsers go a step further and lowercase the host for you. The WHATWG URL Standard, which browsers follow, normalizes the scheme and host but leaves the path alone. You can see it with JavaScript's URL class:

new URL("HTTPS://ConvertCaseHQ.COM/Blog/My-Post").href
// "https://convertcasehq.com/Blog/My-Post"

That last detail is the trap. The host got lowercased, but /Blog/My-Post kept its capitals, because paths can be case-sensitive. On many servers, /Blog/My-Post and /blog/my-post are different pages, or one of them is a 404. We cover that side in our post on lowercase, hyphenated URL slugs.

So capitalizing a domain in print or on a slide is perfectly safe, and writing ConvertCaseHQ.com is easier to read than an unbroken lowercase string. Just don't capitalize anything after the first slash unless the server really expects it.

What about non-English domain names?

Internationalized domain names, like bücher.example, are converted to an ASCII form beginning with xn-- before DNS ever sees them. Capitalization doesn't survive that step either: when a URL is parsed, Bücher.example and bücher.example both become xn--bcher-kva.example.

Are email addresses case-sensitive?

An email address has two halves, split at the last @: the local part (jane.doe) and the domain (example.com). The domain follows DNS rules, so it's case-insensitive. The local part is where it gets interesting. Section 2.4 of RFC 5321, the SMTP standard, says:

The local-part of a mailbox MUST BE treated as case sensitive. Therefore, SMTP implementations MUST take care to preserve the case of mailbox local-parts. In particular, for some hosts, the user "smith" is different from the user "Smith". However, exploiting the case sensitivity of mailbox local-parts impedes interoperability and is discouraged.

Read carefully, that's two instructions aimed at different people. Mail software in transit must not change the case, because only the receiving server is allowed to decide what the local part means. And the people running receiving servers are told not to make case matter; section 4.1.2 says a host that expects to receive mail "SHOULD avoid defining mailboxes where the Local-part is case-sensitive."

Real systems took the hint. Google's Workspace documentation says usernames must be lowercase, and that uppercase letters entered when creating a username are converted to lowercase. In everyday use, mainstream mailbox providers deliver mail however the sender capitalized the address, but not every provider documents that. Treat it as common behavior rather than a guarantee: a small self-hosted server could legally behave differently.

Other "same address" rules belong to the provider

Case isn't the only way two different-looking addresses can reach the same inbox, and this is where developers get burned by being too clever:

  • Dots: Gmail ignores dots in personal addresses, so janedoe@gmail.com and jane.doe@gmail.com are the same account. Google's help page notes the exception: for work or school accounts that use Gmail with their own domain, dots do change the address.
  • Plus tags: Gmail delivers janedoe+news@gmail.com to janedoe@gmail.com, which people use to filter mail. Other providers support similar tags, some don't, and the separator isn't always a plus sign.

Neither rule is part of the email standard. If you strip dots or plus tags from every address you store, you'll merge different people on some domains and break the filters your users set up on purpose. Lowercasing for comparison is the only normalization we'd apply to every address, and even that is a deliberate trade-off, as the next section explains.

How to store and compare email addresses

Here's the approach we'd recommend for sign-ups, mailing lists and anything else with a uniqueness rule:

  1. Trim it. Leading and trailing spaces come from copy and paste far more often than from intent.
  2. Store the address as typed. That's what you display and what you send to, which respects the "preserve case" rule.
  3. Compare a lowercased key. Use lower(email) for lookups and for the uniqueness constraint, so Jane@Example.com can't open a second account next to jane@example.com.
  4. Confirm by sending a message. A confirmation link is the only real proof that an address works and belongs to the person who typed it.

Strictly, step 3 bends the standard, since it assumes no receiving server distinguishes Jane from jane. We think that's the right trade: someone who signs up as Jane@ and later types jane@ at the login screen is a far likelier problem than two real mailboxes that differ only by case. In PostgreSQL it looks like this:

CREATE TABLE users (
  id    bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
  email text NOT NULL
);

-- One account per address, whatever the capitalization
CREATE UNIQUE INDEX users_email_lower_key ON users (lower(email));

-- Look-ups use the same expression, so the index applies
SELECT id FROM users WHERE lower(email) = lower($1);

PostgreSQL's documentation points out that a plain UNIQUE constraint is case-sensitive, and that a query on lower(col) won't use an index unless you create an index on that same expression, which is exactly what the example does. PostgreSQL also offers the citext type for case-insensitive text, though its docs now suggest nondeterministic collations instead, because simple lowercasing doesn't handle every Unicode special case correctly.

That Unicode caveat applies to internationalized email addresses, which can contain non-ASCII characters before the @. For those, lowercasing is a reasonable comparison key in most scripts, but not a perfect one.

Two more practical numbers for column sizes: RFC 5321 limits the local part to 64 octets and a whole path, which wraps the address in angle brackets, to 256. That's where the commonly used 254-character maximum for an address comes from.

Cleaning a list of email addresses

If you've been handed a messy export or a pasted signature block, our case converter can do the first pass in your browser. Apply lowercase first, then Extract emails: it pulls every address out onto its own line and drops exact duplicates, so lowercasing first means Jane@Example.com and jane@example.com collapse into one. It's a pattern match for ordinary ASCII addresses, so unusual ones, such as quoted local parts or addresses with non-Latin characters, won't be picked up. For bigger clean-up jobs, our guide to text case normalization covers trimming, case folding and deduplication in more depth.

The rule of thumb

  • Domains: case never matters. Capitalize them for readability if you like.
  • URL paths: case can matter. Keep them lowercase.
  • Email addresses: keep what was typed, send to what was typed, and compare in lowercase.
  • Dots and plus tags: provider rules, not universal ones. Leave them alone.

© 2026 ConvertCaseHQ. All rights reserved.