Internet checksum (RFC 1071)
The word hello gives the Internet checksum bc2d: its 5 bytes are paired into 16-bit words, added with carries folded back, and the sum is inverted. Paste a header in hex to confirm an IPv4, TCP or UDP checksum without a network stack. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Text
- hello
- Calculation mode
- Text
- Checksum
- bc2d
- Checksum int
- 48,173
- Bytes
- 5
- Algorithm
- Internet checksum (RFC 1071)
Empty input is valid and yields ffff, the natural complement of a zero sum.
What the RFC 1071 Internet checksum is and how words are formed
RFC 1071 specifies a simple integrity residual: treat the message as a sequence of sixteen-bit words in network byte order, add them with one's-complement arithmetic so carries fold back into the low sixteen bits, then take the one's complement of that sum. The result is a sixteen-bit value usually shown as four hexadecimal digits. This Internet checksum calculator implements that exact fold.
In text mode the input string is first encoded as UTF-8 so multi-byte characters contribute their real on-the-wire bytes; in hex mode the string is parsed as raw octets after removing whitespace, colons, dashes, underscores, and optional zero-x prefixes. Words are formed big-endian: the first byte of each pair is the high half and the second byte the low half, matching how IP, TCP, and UDP headers are laid out on the wire.
If the byte length is odd, the final byte is treated as the high half of a word with a zero low byte, as described in section 4.1 of the RFC, so every byte participates without inventing extra data beyond a single zero pad. The algorithm is deliberately not cryptographic: it is cheap, detects many accidental bit flips and truncated pastes, and is the residual routers and stacks already expect. It is not CRC-32, not Fletcher-32, and not a hash family member.
If a third-party tool disagrees on the same bytes, it is almost always using little-endian packing, a different pad rule, a CRC polynomial, or a different encoding of the same characters.
What you can do with it
IP, TCP and UDP header verification
Recompute the RFC 1071 residual over a pasted header or pseudo-header hex dump to confirm IPv4, TCP, or UDP checksum fields without a full network stack.
FAQ
How do I compute an Internet checksum (RFC 1071)?
Default mode is text (UTF-8 bytes). Set mode to hex for raw octets.
What is the difference between text mode and hex mode?
Text mode UTF-8-encodes the string and checksums those bytes. Hex mode parses hexadecimal octets (spaces, colons, dashes, and 0x allowed).
Is the Internet checksum a cryptographic hash?
No. RFC 1071 detects accidental corruption quickly and matches IP/TCP/UDP stacks; it is not designed to resist deliberate collision or forgery. Use SHA-family tools when you need a cryptographic digest.
Why does my result differ from another checksum tool?
Usually the other tool pairs the bytes in the opposite order, pads a lone last byte differently, uses a CRC instead, or encodes the characters another way. Here the first byte of each pair is the high half, as in IP, TCP and UDP headers.
Why does an empty input give ffff?
With no bytes the sum is zero, and the one's complement of zero is ffff. Returning that stable value instead of an error helps when you checksum optional data that may be empty.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/enc/internet-checksum \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"hello"}'const res = await fetch("https://api.kit.forhosting.com/enc/internet-checksum", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "hello"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/enc/internet-checksum",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "hello"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/enc/internet-checksum", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"hello"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"hello"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/enc/internet-checksum", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"text": "hello"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "enc.internet_checksum",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
The Internet checksum is the sixteen-bit one's-complement residual defined in RFC 1071 and used across IPv4, TCP, and UDP so receivers can detect accidental corruption of headers and payloads. This tool accepts either plain text (serialized as UTF-8) or a hexadecimal byte dump, folds the bytes as big-endian sixteen-bit words with carry wraparound, and returns the one's complement as a four-digit lowercase hex string plus the matching unsigned integer. Malformed hex—odd nibble counts or non-hex characters after stripping spaces, colons, dashes, and optional zero-x prefixes—raises invalid_input without billing. No network call, no random salt, and no wall clock enter the computation at the published $0.002 base price.
What the RFC 1071 Internet checksum is and how words are formed
Empty payload produces a zero sum whose one's complement is ffff, which is the identity often used when a field is unused.
Input contract, text versus hex mode, and response fields
Optional mode selects interpretation: text (default) encodes the string as UTF-8; hex parses hexadecimal octets. Empty string is allowed on purpose: pipelines that checksum optional fields need a stable ffff residual instead of a hard failure. Mode echoes the resolved mode, algorithm is always the label Internet checksum open-parenthesis RFC 1071 close-parenthesis, and rfc is always the string one-zero-seven-one so OpenAPI examples and support replies can quote the profile without ambiguity. There is no mode switch for CRC, Fletcher, or cryptographic digests: use a dedicated capability when those are the search intent so each landing page stays focused. POST a JSON body with the required field text set to the string you want to checksum. Aliases input, value, s, string, content, and data are accepted so older forms and short clients still bind. Finite numbers and big integers are stringified before processing; objects, arrays, booleans, null, Infinity, and NaN raise invalid_input and are not billed. When the resulting byte length is zero the response sets empty to true, checksum to ffff, checksum_int to sixty-five thousand five hundred thirty-five, and bytes to zero. For non-empty input empty is false, bytes equals the payload length, checksum is the lowercase four-digit hex residual without a zero-x prefix, and checksum_int is the same value as an unsigned sixteen-bit integer useful in languages that prefer numbers over strings. In hex mode, after stripping separators the remaining characters must be an even count of hexadecimal digits; any other character or an odd nibble count is malformed hex and fails with invalid_input.
Where an Internet checksum API earns its keep
Network engineers paste short header dumps into an Internet checksum calculator when they need to recompute the IPv4 header checksum or a TCP and UDP residual over a pseudo-header plus segment without spinning up a full stack. Support teams recompute checksums from ticket hex to confirm that a pasted frame was not truncated or re-spaced in transit. Continuous-integration jobs pin known vectors such as the UTF-8 string hello and a classic multi-byte hex dump so any accidental endianness or pad-rule drift fails the build immediately. Education labs use the same endpoint to show that flipping one bit changes the four hex digits, illustrating error detection without introducing cryptographic machinery or containerized packet tools. Keep payloads under the documented character ceiling, treat the checksum field as the canonical paste target, and you get reproducible RFC 1071 values for docs, SDKs, edge workers, and classroom demos without standing up a separate checksum service.
Integration use cases
CI golden vectors for protocol code
Pin text and hex fixtures (including empty → ffff) so continuous integration catches endianness, pad-rule, or UTF-8 encoding drift in checksum helpers.
Classroom and ticket demos
Show students and operators how a one-byte edit changes the four-digit Internet checksum using the free browser widget or a single API call.
Technical questions
What happens with empty input?
Empty payload is valid. The response sets empty to true, checksum to ffff, checksum_int to 65535, and bytes to 0. Missing or non-string text raises invalid_input.
What does the Internet checksum tool cost?
The browser widget is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.