# Get the domain of an email address

Take the part after the last @ and lowercase it, for domain checks and grouping.

Canonical: https://1loc.dev/email/get-the-domain-of-an-email-address/
Version: 1.0.0
Runtime: JavaScript · Node.js 22 / modern browsers
Verification: Local fixtures; no external services
Updated: 2026-10-28

## Implementation

```javascript
function emailDomain(address) { return address.slice(address.lastIndexOf('@') + 1).toLowerCase(); }
```

## Input

```json
"Ana.Silva@Example.COM"
```

## Expected output

```json
"example.com"
```

## Edge case

Input:
```json
"\"ana@team\"@example.com"
```
Output:
```json
"example.com"
```

## Limits

- The last @ separates the domain, so a quoted local part containing @ still works. This does not validate the address.
- Domain names are case-insensitive. Oveyon’s disposable-domain lookup takes a domain like this one, so the full address never leaves your backend.

The lab validates types and size before calling this function. Add equivalent validation at your own trust boundary.

## Source and license

Author: Oveyon, written for this edition; not part of the original 1loc collection.
Copyright (c) 2026 Oveyon
License: MIT — https://1loc.dev/licenses/
Maintainer: Oveyon
