# TXT Record Splitter: Split or Join 255-Byte Strings

Split a long DNS TXT value into strings of at most 255 bytes (byte exact and never inside a UTF-8 character), or join strings copied from dig or a zone file back into one value. Input up to 8,192 characters. Returns the strings with their sizes, all four output syntaxes (BIND zone file, quoted strings, a JSON list, the plain value), what the value looks like (DKIM key, SPF record, DMARC policy or other), warnings (a cut that would fall inside a character, an answer over 512 bytes, an SPF record long enough to hit the 10-lookup limit, a missing v=DKIM1) and, in join mode, the seams. A private key is refused and never echoed. Pure computation: the value is not stored.

**Not for:** Checking a published record (use dkim_check, spf_check or dns_lookup).

- Tool id: `txt-record-split`
- Category: dns
- Execution: pure
- MCP tool `txt_record_split` at https://lookupowl.com/mcp
- REST `GET https://lookupowl.com/api/v1/tools/txt-record-split` (or POST a JSON body)
- OpenAPI: https://lookupowl.com/api/openapi.json

## Input

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `value` | string | yes |  | The TXT value, up to 8,192 characters: the whole value, or the strings in quotes. Never stored. min length 1, max length 8192 |
| `mode` | "split" \| "join" | no | `"split"` | split: cut a long value into strings of at most 255 bytes. join: put strings copied from dig or a zone file back into one value. |
| `syntax` | "bind" \| "quoted" \| "json" \| "plain" | no | `"bind"` | The syntax of the answer that opens first: bind (zone file), quoted (strings in quotes), json (a JSON list) or plain (the value, for hosts that cut it for you). All four are always returned in `outputs`. |
| `name` | string | no | `""` | Optional record name, for example s1._domainkey.example.com. It shapes only the zone file line and the comparison. Without it the zone file block has the strings only. max length 253 |
| `ttl` | integer | no | `3600` | Optional TTL for the zone file line, in seconds. min 1, max 2147483647 |

## Output

Results are wrapped in an envelope: `tool`, `version`, `requestId`, `data`, `summary`, `meta` (cache status, timing), `permalink`. `data` has these fields:

| Field | Type | Description |
|---|---|---|
| `mode` | "split" \| "join" |  |
| `syntax` | "bind" \| "quoted" \| "json" \| "plain" |  |
| `name` | string \| null |  |
| `ttl` | number |  |
| `input` | object |  |
| `value` | string \| null | The whole value (the joined one in join mode). null when refused. |
| `bytes` | number |  |
| `strings` | object[] |  |
| `limit` | number | 255. |
| `outputs` | object |  |
| `output` | string \| null | The one of `outputs` picked by `syntax`. |
| `seams` | object[] | Join mode: the 30 characters on each side of every join. |
| `detected` | object |  |
| `warnings` | object[] |  |
| `suggest` | string | Split mode: the text looks like quoted strings, so Join is probably what you want. Never switched for you. |
| `refused` | string | The text holds a private key: it is not processed and not echoed. |

## Examples

### A 2048-bit DKIM key that needs two strings

```json
{"value":"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAQ2xhdWRlIGlzIHRoZSBleGFtcGxlIGZvciBhIGxvbmcga2V5Q2xhdWRlIGlzIHRoZSBleGFtcGxlIGZvciBhIGxvbmcga2V5Q2xhdWRlIGlzIHRoZSBleGFtcGxlIGZvciBhIGxvbmcga2V5Q2xhdWRlIGlzIHRoZSBleGFtcGxlIGZvciBhIGxvbmcga2V5Q2xhdWRlIGlzIHRoZSBleGFtcGxlIGZvciBhIGxvbmcga2V5Q2xhdWRlIGlzIHRoZSBleGFtcGxlIGZvciBhIGxvbmcga2V5Q2xhdWRlIGlzIHRoZSBleGFtcGxlIGZvciBhIGxvbmcga2V5Q2xhdWRlIGlzIHRoZSBleGFtcGxlIGZvciBhIGxvbmcga2V5IDAQAB","mode":"split","syntax":"bind","name":"s1._domainkey.example.com","ttl":3600}
```

```bash
curl 'https://lookupowl.com/api/v1/tools/txt-record-split?mode=split&name=s1._domainkey.example.com&syntax=bind&ttl=3600&value=v%3DDKIM1%3B+k%3Drsa%3B+p%3DMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAQ2xhdWRlIGlzIHRoZSBleGFtcGxlIGZvciBhIGxvbmcga2V5Q2xhdWRlIGlzIHRoZSBleGFtcGxlIGZvciBhIGxvbmcga2V5Q2xhdWRlIGlzIHRoZSBleGFtcGxlIGZvciBhIGxvbmcga2V5Q2xhdWRlIGlzIHRoZSBleGFtcGxlIGZvciBhIGxvbmcga2V5Q2xhdWRlIGlzIHRoZSBleGFtcGxlIGZvciBhIGxvbmcga2V5Q2xhdWRlIGlzIHRoZSBleGFtcGxlIGZvciBhIGxvbmcga2V5Q2xhdWRlIGlzIHRoZSBleGFtcGxlIGZvciBhIGxvbmcga2V5Q2xhdWRlIGlzIHRoZSBleGFtcGxlIGZvciBhIGxvbmcga2V5IDAQAB'
```

Web page: https://lookupowl.com/txt-record-splitter?name=s1._domainkey.example.com

### Join the two strings of an SPF record

```json
{"value":"\"v=spf1 include:_spf.example.net ip4:198.51.100.0/24 \" \"include:mail.example.org -all\"","mode":"join","syntax":"plain","name":"","ttl":3600}
```

```bash
curl 'https://lookupowl.com/api/v1/tools/txt-record-split?mode=join&name=&syntax=plain&ttl=3600&value=%22v%3Dspf1+include%3A_spf.example.net+ip4%3A198.51.100.0%2F24+%22+%22include%3Amail.example.org+-all%22'
```

Web page: https://lookupowl.com/txt-record-splitter?mode=join&syntax=plain

## Web pages

- https://lookupowl.com/txt-record-splitter

## Limits and caching

- Cost: 1 unit for a live lookup, 1 unit for a cached one. Budgets are per network and published in the `RateLimit` response headers.
- Cache: results are never cached.
- Timeout: 5 s.

## Related tools

- [DKIM Record Checker](https://lookupowl.com/tools/dkim-checker.md): Find and check a domain's DKIM public keys, even when you do not know the selector.
- [DKIM Generator: Make a Key and the DNS Record](https://lookupowl.com/tools/dkim-record-format.md): Make a DKIM key in your browser and get the DNS record, split correctly, with a zone line and mail server snippets.
- [DNS Lookup](https://lookupowl.com/tools/dns-lookup.md): Look up A, AAAA, MX, NS, TXT, CNAME, SOA, CAA, DS and DNSKEY records from a public resolver or the authoritative nameserver.
- [SPF Record Checker](https://lookupowl.com/tools/spf-checker.md): Check a domain's SPF record, count its DNS lookups against the limit of 10 and find errors.
- [SPF Flattener and Lookup Limit Fixer](https://lookupowl.com/tools/spf-optimize.md): Fix an SPF record that needs more than 10 DNS lookups: see what each include costs, pick the safest fixes and get the new record.

## Guide: TXT record splitter

Cut a long TXT value into the 255-byte strings DNS allows, in the syntax your DNS host expects, or join strings from dig back into one value.

### The 255-byte rule

A DNS TXT record holds text in strings, and each string is at most 255 bytes. A record can have several strings, and a reader puts them together with nothing between them. A 2048-bit DKIM key, a long SPF record or a verification token often does not fit in one string, and DNS hosts disagree on who does the cutting: some do it for you, some want quoted strings, some want a zone file block.

The splitter cuts at exactly 255 bytes and never inside a multi-byte character, so a value with an accented letter at the cut still reads back correctly. It shows the result in four syntaxes, as tabs, and you copy the one your host asks for.

### The four syntaxes

| Tab | What it looks like | For |
|---|---|---|
| Zone file (BIND) | `name. 3600 IN TXT ( "first" "second" )` | BIND, NSD, Knot, PowerDNS and any "import a zone" box |
| Quoted strings | `"first" "second"` | Route 53 and panels that show the strings in quotes |
| JSON list | `["first", "second"]` | An API body |
| Plain value | The whole value in one piece | Hosts that cut a long value for you |

If you do not know which your host wants, try the quoted strings first: if the panel rejects the value as too long, the plain value is for hosts that do the cutting themselves, and if it asks for a zone file, use the first tab. Add a record name under More options and the zone file line carries it, with a TTL.

### Joining strings back

Choose Join and paste what `dig` or a zone file shows: quoted strings, a block in parentheses, a line that starts with the name and `IN TXT`, or a JSON list. The strings are joined with nothing between them, which is how DNS does it. That matters: a tool that adds a space where two strings meet breaks the record when the cut falls inside a word, as it does in an SPF record that is cut in the middle of an address.

The page shows the 30 characters on each side of every seam, and says when the cut falls inside a word. A string over 255 bytes is marked as an error, because a record with such a string would not load.

### Where your text goes

With JavaScript on, the value is split in your browser and nothing you paste is saved. A DKIM record is a public key and is public by design, but the tool is careful anyway: it refuses anything that looks like a private key and does not show it back.

Without JavaScript the form sends the value to our server for that one request. We split it, show the result and keep nothing: it is not stored, not logged and not cached, and the page address has no query. The one optional thing that can leave your browser is the record name, and only when you press Compare, to read what DNS serves now. The value is never sent.

### Frequently asked questions

**Does my DNS host split the value for me?**

Some do, and then you paste the plain value. If your host shows a single box and rejects the value as too long, use the quoted or zone file tab instead.

**Why 255 bytes and not 255 characters?**

DNS counts bytes. A plain ASCII character is one byte, but an accented letter is two and an emoji is four, so a string with them holds fewer than 255 characters. The splitter counts bytes and moves a cut earlier rather than split a character.

**Is it safe to paste a DKIM key here?**

A DKIM record holds a public key and is public by design. The page still keeps it in your browser, and it refuses anything that looks like a private key.

**How do I check the record once it is published?**

Use the [DKIM checker](https://lookupowl.com/dkim-checker) for a DKIM key, or read the record back with [DNS lookup](https://lookupowl.com/txt-lookup). Press Compare on the result to see whether DNS serves the same value you split.

**Can I make a new DKIM key here?**

No, this tool only cuts and joins. The [DKIM generator](https://lookupowl.com/dkim-generator) makes a key and writes its record, already split.
