The mailto: URI encoder builds a valid RFC 6068 mailto: link from a recipient list plus optional Cc, Bcc, subject and body. Each field is percent-encoded correctly so the link survives in HTML, QR codes and chat messages, and opens the user’s mail client with everything pre-filled.
How it works
A mailto link has the form mailto:address?key=value&key=value. The To addresses sit before the ?; additional recipients and the message use query parameters cc, bcc, subject and body. RFC 6068 requires that values be percent-encoded: every byte that is not an unreserved character is replaced with % plus its two-digit hex code.
The encoder uses encodeURIComponent for each value, then fixes the special cases the standard calls out — line breaks in the body must be %0D%0A, and a few characters are left readable. Parameters are joined with &. Empty fields are omitted, so a To-only link is simply mailto:[email protected].
What each field does
To — the primary recipient address(es). Multiple addresses are comma-separated in the URI. Most mail clients accept Name <email> syntax if URL-encoded properly, but plain addresses are the most compatible.
Cc — carbon copy. Recipients in Cc see each other’s addresses and receive the same message. Encoded as the cc query parameter.
Bcc — blind carbon copy. Bcc recipients receive the message but are not visible to To or Cc recipients. Browser mailto support for Bcc varies significantly — some clients honour it, others ignore the field entirely. Test with your target client.
Subject — pre-fills the subject line. Spaces encode as %20; special characters like &, =, and # are percent-encoded.
Body — pre-fills the message body. Line breaks must be %0D%0A (CRLF) per the RFC, not just %0A. This tool handles that encoding automatically.
Worked example
To: [email protected]
Cc: [email protected]
Subject: Hello there
Body: Line one
Line two
Output:
mailto:[email protected]?cc=team%40example.com&subject=Hello%20there&body=Line%20one%0D%0ALine%20two
The @ in the Cc address is encoded as %40 because it sits inside a query parameter value. In the To position (before the ?) it can appear unencoded.
Where to use mailto links
- Website contact buttons:
<a href="mailto:[email protected]?subject=Help">Email us</a>opens a pre-addressed compose window. - HTML email signatures: embed a pre-filled feedback or reply link.
- QR codes: a mailto URI in a QR code opens the compose window on mobile. Shorter bodies work better here since QR data density limits apply.
- React and front-end apps:
window.location.href = 'mailto:...'triggers the mail client. Some browsers block this for non-user-initiated events. - Markdown documentation:
[Open issue](mailto:[email protected]?subject=Bug%20report)works in most Markdown renderers.
Limitations to be aware of
- URL length: browsers cap URL length (commonly 2048–8192 characters). Long pre-filled bodies may be silently truncated. Keep bodies under roughly 1,500 characters for broadest compatibility.
- Bcc: not universally respected by all email clients. Outlook, Apple Mail, and Thunderbird handle it differently. If Bcc is critical, test before relying on it.
- HTML vs. plain text: mailto links produce plain-text compose windows. If you need to pre-fill HTML formatted email, mailto is not the right tool.
- Webmail clients: Gmail, Outlook.com, and other web-based clients typically intercept mailto links only if the user has set them as the default handler in their browser.
Notes
Everything runs locally; nothing you type is uploaded. The output drops straight into <a href="mailto:..."> or any other context that accepts a URI.