DKIM Key Size Calculator for DNS TXT Records

July 15, 2026

DKIM Key Size Calculator

Estimate RSA or Ed25519 DKIM TXT record length, DNS chunks, provider fit, selector naming, DNSSEC overhead, and rotation footprint before publishing.

⚡Named DKIM Presets

Each preset uses a named onclick handler and immediately recalculates the TXT footprint.

🔧DKIM Record Inputs
Estimated TXT value 0 characters including tags
TXT chunks 0 quoted strings
Full owner name 0 characters
Rotation zone load 0 bytes with DNSSEC estimate
Provider fit Check limit status
Label safety OK DNS label and name limits
📊Derived DKIM Size Metrics
392Public key chars
27Tag overhead
460Approx wire bytes
1024Provider limit
🗂Provider Comparison Grid

Cloudflare

Usually supports multi-string TXT records.

Typical fit: 2048 RSA works.

Watch: pasted quotes.

Route 53

Accepts long TXT values split into strings.

Typical fit: 4096 possible.

Watch: zone file import.

Google DNS

Modern UI handles common DKIM records.

Typical fit: 2048 RSA works.

Watch: copied spaces.

cPanel DNS

Behavior depends on host version and UI.

Typical fit: 1024 or 2048.

Watch: field truncation.

Microsoft 365

Often publishes CNAME selectors instead of raw keys.

Typical fit: CNAME model.

Watch: selector pairs.

Google Workspace

Commonly uses generated 1024 or 2048 RSA keys.

Typical fit: 2048 RSA.

Watch: long domain names.

SendGrid

Uses provider supplied hostnames and values.

Typical fit: delegated records.

Watch: multiple selectors.

Amazon SES

Easy DKIM normally uses three CNAME records.

Typical fit: CNAME model.

Watch: label length.

📝Key Size Reference Table
Key choiceApprox p tagCommon chunksPractical note
1024-bit RSA216 to 230 chars1Legacy compatible, but weaker than modern defaults.
2048-bit RSA388 to 410 chars2Common balance for current DKIM deployments.
4096-bit RSA728 to 760 chars3 to 4Large TXT record; verify provider and resolver behavior.
Ed2551944 to 80 chars1Compact, but receiving support varies by ecosystem.
🌐DNS Name and TXT Limits
LimitValueCalculator checkWhy it matters
DNS label length63 charsSelector and each domain labelLong selectors can fail before the TXT value is evaluated.
Full DNS name253 charsselector._domainkey.domainDeep subdomains consume owner-name budget quickly.
TXT string255 charsChunk countLong DKIM values must be split into quoted strings.
UDP responseSize variesWire bytes plus DNSSECLarge signed answers may require EDNS0 or TCP fallback.
🔁Rotation Planning Table
Rotation modelActive selectorsZone footprintRecommended use
Single live key1LowestSmall domains with one sender and simple rollback needs.
Blue and green2ModerateMost home labs, SaaS apps, and business domains.
Per provider3 to 6HigherDomains using Workspace, marketing mail, and ticket systems.
Staged migration4+HighestShort-term migrations where old mail may still validate.
🧪Algorithm and Provider Compatibility
AlgorithmDNS sizeCompatibilityOperational guidance
rsa-sha256 1024SmallVery broadUse only when a provider cannot publish 2048-bit keys.
rsa-sha256 2048MediumVery broadDefault choice for most production DKIM records.
rsa-sha256 4096LargeBroad, but DNS-sensitiveValidate with your DNS host and external DKIM testers.
ed25519-sha256Very smallEmergingUse as a pilot or secondary selector when receivers support it.
💡DKIM Publishing Tips
Chunk deliberately: DNS permits multiple quoted strings inside one TXT record. The calculator counts how many strings your DKIM value needs.
Keep selectors short: A readable selector such as s2026 or mail1 leaves more room for deep delegated domain names.
Plan overlap: Keep old and new selectors published during rotation so delayed mail can still validate.
Test externally: After publishing, verify the selector from outside your DNS provider cache and check the full DKIM signature path.

Making a DKIM key is not as simple as pushing a button and pasting text into your DNS configuration. You need to understand what the key does to your domain and how the key impact that functionality. Does it mean splitting up your data? Will this be acceptable to my DNS provider? Most admins don’t know any of this, unless they is running into errors when upgrading/rotating keys.

By plugging in your preferred bit strength and domain structure into the calculator above, you’ll get the numbers needed. It eliminates any need to guess at impact of a 4096-bit key on DNS load.

How DKIM Key Size Affects Your DNS

To start with, select an algorithm (RSA or Ed25519). You start by choosing between RSA and Ed25519. For that, 2048 bits are a good compromise between a key being large enough and not being too big. The bigger 4096-bit key is more secure against cracking efforts in the distant future, but it make the public key almost twice as long. And the longer public key mean less room for those TXT record values.

Why does chunk size matter? DNS systems splits long text records into several strings. Typically, each string must be 255 characters or fewer. For example, a 1024-bit key may well fit in a single string, while an RSA key of 2048 bits will typically need two or three. The tool calculates that for you.

Smaller keys are more manageable if your DNS interface isn’t up to handling multi-string records properly. Some providers also silently truncate anything longer than a certain length, breaking authentication and leading to difficult-to-spot errors.

The other factor is selector length. That’s the first component of the DKIM record name (e.g., `default._domainkey.example.com`). By default you get to pick any length up to 63 characters. But if you go too far into your domain’s namespace with that selector, it may push past the 253-character maximum for a complete DNS name. The calculator accounts for this footprint when analyzing records. Often folks are tripped by this when they think of selectors as titles and not technical identifiers, so make ’em short.

This introduces some additional complexity: don’t just change all your keys to a different one on day X in production. For best practice, run two keys concurrently so old emails can still validate while new ones signs with the fresh key. So that briefly doubles the size of your zone file. That’s noticeable if you are doing DNSSEC because that adds its own signature overhead.

Zone load is a good measure of what this feels like. Does your DNS provider handle serving those bigger responses well? Not all providers are created equal: Modern control panels will accommodate long TXT records just fine; some older ones choke on anything greater than 1024 characters. A fit error indicates that you probably have selected an overly-large key for your panel’s UI. To fix it, select a smaller key or upload via API. The former does not greatly impact security and doesn’t require any new infrastructre.

Another alternative would of Ed25519. It’s faster to verify, and its keys is smaller than RSA keys (making the DNS overhead less). Not all services will support this yet, though. You can use it as a pilot key in addition to your primary RSA key to see how it performs without risking deliverability.

DKIM design is a compromise between security requirements and practical limits. A key must be long enough to be secure but short enough to fit into your DNS zone and rotate by running two keys simultaneous for a period. This table makes those compromises explicit. By understanding how many characters are used for each bit and what chunking means, you won’t have to guess anymore, and will confidently serve up the right records to your users.

DKIM Key Size Calculator for DNS TXT Records

Related posts

Leave a Comment