Browse 1000+ Public APIs

Mailgun vs SendGrid Free Tier in 2026: A Developer's Honest Comparison

2 minutes ago11 min reademail-apis

Every side project eventually needs to send an email. A password reset. A receipt. A "your export is ready" notification. And every developer at that moment lands on the same question: Mailgun or SendGrid, and can I get away with the free plan?

The honest answer in 2026 is that "free tier" means something different at each provider, and the difference matters more than the headline numbers. One gives you a generous trial that expires. The other gives you a small allowance that doesn't. Choosing wrong means either a surprise invoice or a migration two months into production.

This comparison covers what actually ships on each free plan, how the APIs differ in practice, what deliverability tooling you get without paying, and where each one breaks down.

The short version

Mailgun Free SendGrid Free
Send allowance ~100 emails/day (trial period), then plan required 100 emails/day, ongoing
Trial window Limited-duration trial with a higher initial allowance No expiry on the free plan itself
Authorized recipients Yes — free/trial sending is restricted to verified addresses No recipient allowlist
Custom domain sending Supported (DNS verification required) Supported (domain authentication required)
Log retention ~1 day on entry tiers ~3 days of activity history
Inbound/receiving email Yes — routes and inbound parsing Yes — Inbound Parse webhook
Email validation Limited free validations Separate paid add-on
Dedicated IP Paid only Paid only
SMTP relay Yes Yes
Template management API + handlebars-style substitution Dynamic Templates with a visual editor

The single most important line in that table is authorized recipients. Mailgun's free/trial sending only reaches addresses you've explicitly verified. That's fine while you're building — you're emailing yourself anyway — but it means a Mailgun free account can never serve real users. SendGrid's free plan can, at 100 emails a day, indefinitely.

If your question is "which free tier can quietly run my small production app," the answer is SendGrid. If it's "which provider should I evaluate seriously before paying," the answer is more interesting.

What you actually get: Mailgun's free tier

Mailgun's modern free offering is structured as a trial. You get a sandbox domain immediately (sandboxXXXX.mailgun.org), a meaningful send allowance during the trial window, and full API access. After the trial, the account drops to a heavily restricted state that expects you to pick a paid plan.

The sandbox domain is the part developers trip over. It works instantly with zero DNS setup, which makes it perfect for local development, but it only delivers to authorized recipients — addresses you add and verify in the dashboard, capped at a handful. Send to anything else and the API returns a 200, the message is accepted, and then it's dropped. Your logs will show the rejection; your integration tests will not.

To send to arbitrary addresses you add your own domain and complete DNS verification: TXT records for SPF and DKIM, plus a CNAME for tracking and optional MX records if you want inbound routing. That part is the same on free and paid.

Sending a message is a multipart/form-data POST with HTTP Basic auth — no SDK required:

curl -s --user "api:$MAILGUN_API_KEY" \
  https://api.mailgun.net/v3/$MAILGUN_DOMAIN/messages \
  -F from='Acme <postmaster@mg.acme.dev>' \
  -F to='dev@acme.dev' \
  -F subject='Your export is ready' \
  -F text='Download it within 24 hours.' \
  -F o:tag='exports' \
  -F v:user_id='8813'

Two things there are genuinely nice. The o: prefix sets sending options (tags, tracking, scheduled delivery, test mode), and the v: prefix attaches custom variables that come back verbatim in webhooks. When a bounce arrives three days later, user_id is right there in the payload — no correlation table needed.

Mailgun's regional split is also worth knowing: EU accounts use api.eu.mailgun.net, and an account created in one region can't be addressed through the other's hostname. If you're subject to GDPR data residency requirements, choose the region at signup, because moving later means recreating the domain.

Where Mailgun's free tier shines: the logs and analytics API. Even on entry tiers you can query events programmatically:

curl -s --user "api:$MAILGUN_API_KEY" \
  -G https://api.mailgun.net/v3/$MAILGUN_DOMAIN/events \
  --data-urlencode 'event=failed OR complained' \
  --data-urlencode 'begin=Mon, 01 Sep 2026 00:00:00 GMT'

That endpoint is paginated, filterable, and returns structured delivery-status reasons — the SMTP code, the receiving MTA's response text, and Mailgun's own classification (permanent vs temporary). For debugging why Gmail deferred your mail, it's the best free diagnostic surface either provider offers. The catch: retention on the lowest tiers is around a day, so you need to be watching when it happens or pipe events to your own store via webhooks.

What you actually get: SendGrid's free tier

SendGrid's free plan is simpler to describe: 100 emails per day, forever, no trial clock. You get the full v3 API, SMTP relay, Dynamic Templates, event webhooks, and roughly three days of activity history in the UI.

There's no authorized-recipient restriction, so a free SendGrid account can genuinely serve a small live application. A hundred sends a day covers a lot: signup confirmations for a few dozen new users, password resets, admin alerts, low-volume transactional traffic.

The API is JSON, and the request body is more structured than Mailgun's form encoding:

curl -s -X POST https://api.sendgrid.com/v3/mail/send \
  -H "Authorization: Bearer $SENDGRID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "personalizations": [{
      "to": [{"email": "dev@acme.dev"}],
      "dynamic_template_data": {"first_name": "Sam", "expires_in": "24 hours"}
    }],
    "from": {"email": "no-reply@acme.dev", "name": "Acme"},
    "template_id": "d-1a2b3c4d5e6f7890",
    "custom_args": {"user_id": "8813"}
  }'

personalizations is SendGrid's signature abstraction and the reason people either love or hate the API. Each entry is a distinct recipient set with its own substitution data, subject override, headers, and send time — up to 1,000 per request. For a batch of personalized emails it's excellent: one API call, per-recipient content, no recipient ever seeing another's address. For sending a single email it's noticeably more ceremony than Mailgun's flat form.

Dynamic Templates are the strongest thing on SendGrid's free plan. Templates live server-side with versioning and a Handlebars subset ({{#if}}, {{#each}}, conditionals on custom data). Your application ships a template_id plus a JSON blob, and marketing can edit copy without a deploy. Mailgun has template storage too, but SendGrid's editor and versioning workflow is more mature, and it's fully available before you pay anything.

The free plan's real weakness is observability. Three days of activity history is thin, and detailed event search is gated behind paid add-ons. You can — and should — set up the Event Webhook immediately and store events yourself, but that's infrastructure you have to build.

A structural note: SendGrid requires sender verification before your first send, either single sender verification (one address, quick) or full domain authentication (CNAME records, required for real deliverability). Skip domain authentication and your mail sends from a shared SendGrid subdomain, which measurably hurts inbox placement. Do the DNS work on day one.

API ergonomics compared

Both APIs are stable, well documented, and have official SDKs across Node, Python, Go, PHP, Ruby, Java, and C#. The differences are stylistic but they compound.

Authentication. Mailgun uses HTTP Basic with the literal username api and your key as the password. SendGrid uses a bearer token. SendGrid's API keys support granular scopes — a key that can only send mail, or only read stats — which is a real security advantage when you're distributing keys across services. Mailgun offers sending keys and domain-scoped keys, but the permission model is coarser.

Error handling. Mailgun returns plain-text or minimal JSON errors with standard HTTP codes. SendGrid returns a structured errors array with a field pointer and a help link, which is easier to surface programmatically:

{"errors":[{"message":"The from email does not contain a valid address.","field":"from.email","help":"http://sendgrid.com/docs/API_Reference/..."}]}

Batching. SendGrid's personalizations handles 1,000 recipients per call natively. Mailgun's equivalent is recipient variables — a recipient-variables JSON map plus %recipient.name% placeholders in the body, capped at 1,000 recipients per call. Both work; SendGrid's is harder to get subtly wrong.

Webhooks. Both sign their event payloads. Mailgun uses HMAC-SHA256 over a timestamp and token; SendGrid uses an ECDSA signature over the raw body. Verify signatures in both cases — an unauthenticated webhook endpoint that mutates user state is a live vulnerability, not a theoretical one.

Inbound email. Both parse inbound mail and POST it to your endpoint. Mailgun's Routes system is more expressive: you write filter expressions (match_recipient(".*@acme.dev")) with priorities and multiple actions per route, including store-and-notify. SendGrid's Inbound Parse binds a hostname to a single URL. If you're building anything email-driven — support ticketing, +tag addressing, reply-to-thread — Mailgun's routing is the better primitive, and it's available on free/trial accounts.

Deliverability: the part free tiers can't fix

Neither free plan includes a dedicated IP, so you're on shared pools with everyone else's traffic. In practice, at low volume, shared IPs are usually the right choice — a dedicated IP with 100 sends a day never builds enough reputation to warm properly and will perform worse.

What actually determines whether your mail lands:

  1. SPF, DKIM, and DMARC on your own domain. Both providers give you the records. Both free tiers support this. Do it before your first real send.
  2. Not emailing bad addresses. Bounce rate above ~2% is where mailbox providers start throttling you. This is the single most controllable factor, and it's why validating addresses at signup pays for itself.
  3. Honoring unsubscribes and complaints. Both providers maintain suppression lists automatically. Don't route around them.

Point two is where a free-tier email account often needs help. Mailgun bundles a small number of free email validations, which is genuinely useful — its validation service checks syntax, DNS/MX records, role addresses, and known disposable domains. SendGrid's Email Validation API is a paid add-on not included in the free plan.

If you'd rather not spend the budget on either, there are free validation APIs worth wiring into your signup form. Disify checks whether an address belongs to a disposable/throwaway provider, which alone kills a large share of junk signups. Verifier does syntax plus mailbox-existence checks with no key required. Both are listed in our email API directory, alongside other options for validation and delivery. Dropping a disposable-domain check in front of your send pipeline protects your bounce rate regardless of which provider you choose — and on a 100-email-a-day allowance, every wasted send is expensive.

// Cheap pre-send guard: don't burn quota on disposable addresses
async function isDisposable(email) {
  const res = await fetch(`https://disify.com/api/email/${encodeURIComponent(email)}`)
  const { disposable, dns } = await res.json()
  return disposable || !dns
}

Where each free tier runs out

Mailgun runs out on time. The trial ends, and the authorized-recipient restriction means it was never a production path anyway. Treat Mailgun's free tier as an evaluation — a way to test the API surface, the logs, and the routing system before committing. Its paid entry plan is priced per-thousand-emails with a monthly floor, and it stays reasonable at moderate volume.

SendGrid runs out on volume. 100 emails a day is 3,000 a month, and you will hit it faster than you expect once you have real users — a signup email, a verification email, a welcome email, and a weekly digest is four sends per user per week. At 200 active users you're over. SendGrid's first paid tier jumps to a much higher allowance, but it's a step change in cost, not a gradual one.

There's a subtler failure mode on SendGrid's free plan: the daily cap is a daily cap. A batch job that fires 400 emails at 2am gets the first 100 through and hard-fails the rest with a 429. Build in queuing and retry with backoff, or you'll silently drop mail.

Which one should you pick?

Pick SendGrid's free tier if you're shipping a small live application and need real users to receive real email at no cost. It's the only one of the two that supports that. Dynamic Templates and scoped API keys are meaningful bonuses.

Pick Mailgun if you're evaluating for something that will be paid soon and your workload is email-heavy in ways that need good tooling: inbound routing, tagging, programmatic log analysis, EU data residency. The free trial exists to let you verify those things work for you. Don't plan to live on it.

Pick neither, for now, if you're sending fewer than a dozen transactional emails a day and can tolerate simpler tooling. There are lighter-weight options in our API directory with less setup overhead than either of these, and going straight to a purpose-built transactional service will often cost less than a SendGrid or Mailgun paid tier at low volume.

Whichever you pick, do three things on day one: authenticate your sending domain with SPF and DKIM, store webhook events in your own database rather than trusting either provider's short retention window, and validate addresses before you send to them. Those three decisions determine your deliverability far more than the choice between these two providers — and unlike the free tier you started on, they don't expire.