InputTestHub

DKIM Record Formatter

Turns a DKIM public key into a DNS TXT value and splits it into the 255-character strings a long key requires.

Developer Nothing uploaded No sign-up Free, unlimited
Developer tool
The PEM block, or just the base64 after p=.
Paste something on the left to see the result.
In short A DNS TXT record is stored as one or more strings and each string is limited to 255 characters. A 2048-bit DKIM public key is about 392 characters of base64, so it cannot fit in one string and must be published as several quoted strings that the resolver joins together with nothing between them. A DNS panel that accepts the key as a single long unsplit value usually truncates it silently, which leaves a record that looks present while every signature fails to verify — this is the single commonest DKIM fault. The DKIM Record Formatter on inputtesthub.com strips the PEM wrapper, builds the v=DKIM1; k=rsa; p=… value and splits it correctly.

How to use the DKIM Record Formatter

  1. Paste the public key, PEM block and all.
  2. Set the selector your mail server uses.
  3. Copy the quoted, split version into your DNS panel exactly as shown.

About the DKIM Record Formatter

The DKIM Record Formatter turns a DKIM public key into a DNS TXT value and splits it into the 255-character strings a long key requires. It runs as plain JavaScript inside the page, which means there is no upload step, no queue and no size limit imposed by a server — the only limit is your own device.

What people use it for

  • Publishing a DKIM key your mail server generated.
  • Fixing a DKIM record that was truncated by a DNS panel.
  • Working out why signatures fail when the record looks right.

Details

Publish atselector._domainkey.yourdomain.com
TXT string limit255 characters each
2048-bit keyAbout 392 characters of base64 — needs two strings
1024-bit keyFits in one string, and is now considered weak
Testing modet=y tells receivers to ignore failures
Testing mode (t=y) tells receivers to treat a failure as though DKIM were not there. It is useful for the first day of a rollout and harmful afterwards — a key left in testing mode gives no protection at all while appearing fully configured.

Where this tool stops

Formats the public half for DNS. It cannot generate a key pair, and it cannot check that this key matches the private key your server signs with — a mismatched pair produces a record that looks perfect and fails every signature.

Frequently asked questions

Why does my DKIM record need splitting?
Because a DNS TXT record is made of strings and each string stops at 255 characters. A 2048-bit key is about 392 characters of base64, so it needs two. The resolver concatenates them with nothing between, so the value that arrives is identical — the splitting is a storage detail, not a change to the key.
My DNS panel accepted the whole key on one line. Is that fine?
Sometimes, and it is worth checking rather than assuming. Good panels split it for you. Others truncate at 255 characters without warning, which leaves a record that exists, looks plausible and fails every signature. If DKIM fails while the record is clearly published, truncation is the first thing to test.
What is a selector for?
It lets one domain publish several keys at once — <code>google._domainkey</code>, <code>sendgrid._domainkey</code> and so on — so each service signs with its own, and one can be rotated or revoked without touching the others. The selector is named in the signature header of every message you send.
Should I use 1024-bit or 2048-bit?
2048. It has been the expectation for years and several large receivers now treat 1024 as weak. The only argument ever made for 1024 was that it fit in one TXT string, which is a DNS-panel convenience rather than a security consideration.
Is the DKIM Record Formatter free, or is there a paid tier?
Free, unlimited, and no email address required. You can use it a hundred times a day and nothing changes.
Can you see what I put into this page?
No. The DKIM Record Formatter runs entirely in your browser using JavaScript. Your input never reaches inputtesthub.com or any third party — open your browser's Network tab while you use it and you will see no request go out.
Who is the DKIM Record Formatter for?
The jobs it is built for: publishing a DKIM key your mail server generated. Fixing a DKIM record that was truncated by a DNS panel. Working out why signatures fail when the record looks right. It is built for exactly those cases rather than being a general-purpose tool with this bolted on.
Where does the DKIM Record Formatter stop being reliable?
Formats the public half for DNS. It cannot generate a key pair, and it cannot check that this key matches the private key your server signs with — a mismatched pair produces a record that looks perfect and fails every signature. Knowing where a tool stops being trustworthy matters more than the cases where it works.
What are the key numbers for the DKIM Record Formatter?
Publish at is <code>selector._domainkey.yourdomain.com</code>. TXT string limit is 255 characters each. 2048-bit key is About 392 characters of base64 — needs two strings. These are printed on the page itself, so you do not have to take them on trust.
Is there an app version?
Yes. The page is responsive and the page works in Chrome, Safari, Firefox, Edge and Samsung Internet on both Android and iOS. There is no app to install and nothing to sign into.

Related developer tools

All 92
01

JSON Formatter

Formats, indents and validates JSON with precise error positions, key sorting and a…

02

JSON Validator

Checks whether JSON is valid and reports the exact line, column and reason for the first error…

03

JSON Minifier

Strips all whitespace from JSON to produce the smallest valid output, showing the bytes saved.

04

JSON to CSV Converter

Converts a JSON array of objects into CSV, flattening nested keys and handling missing fields…

05

CSV to JSON Converter

Turns CSV or TSV into a JSON array of objects, with type detection for numbers and booleans.

06

JSON to XML Converter

Converts JSON into well-formed XML with a configurable root element and array item naming.

07

XML to JSON Converter

Parses XML and converts it to JSON, preserving attributes and handling repeated elements as…

08

JSON to YAML Converter

Converts JSON to clean YAML with correct indentation, quoting and multi-line string handling.

09

YAML to JSON Converter

Parses YAML and outputs equivalent JSON, with support for anchors, lists and nested maps.

10

JSON Escape and Unescape

Escapes a string for safe embedding inside JSON, and unescapes a JSON string back to plain text.