ForHosting KIT · Developer Utilities

CAS Registry Number check digit

Enter 7732-18 and get check digit 5, giving 7732-18-5, the CAS number of water; type 7732-18-6 instead and validation fails. It catches keying errors in inventories, safety data sheets and lab records. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Cas
7732-18
You get
Calculation mode
Compute
Input
773218
Check digit
5
With check
7732185

Chemical Abstracts Service (CAS) Registry Numbers identify substances in inventories, SDS sheets, lab notebooks, and regulatory filings. Each CAS RN ends with a single check digit derived from a right-to-left weighted sum of the digits that come before it. A mistyped middle digit or a swapped pair often breaks that checksum, so validating the check digit before looking up a compound catches many keying errors early.

What a CAS Registry Number check digit is and why it matters

A CAS Registry Number is a unique numeric identifier assigned to a chemical substance. The printed form groups digits with hyphens into three parts: a variable-length first block, a two-digit middle block, and a final single check digit. That last digit is not arbitrary marketing fluff — it is computed so that a weighted sum of all preceding digits, taken from right to left with multipliers one, two, three, and so on, is congruent to the check digit modulo ten.

When someone types 7732-18-5 (water) as 7732-18-6, the sum no longer matches and validation fails. The same rule catches many single-digit substitutions in inventory imports, SDS parsers, and LIMS fields where operators re-key numbers from paper. This tool implements that standard CAS RN check-digit rule on pure digits after optional hyphen stripping.

It does not query the CAS registry, resolve a name to a number, or prove that a substance exists — only that the digit string is well formed under the published check algorithm. Compared with Luhn mod-10 used on payment and account strings, the CAS scheme uses increasing position weights from the right rather than alternate doubling, so you must not reuse a Luhn validator on CAS fields.

Compared with ISBN or barcode check digits, CAS is chemistry-specific and expects the familiar N-NN-C layout when you format the result for display. Knowing which scheme you need avoids false confidence when a general check-digit utility happens to accept a digit string that is not a CAS RN.

Where CAS check digits fit lab, inventory, and compliance workflows

Laboratory information systems store CAS RNs on reagent and material master records; a single mistyped digit during onboarding can attach the wrong hazard profile to a bottle barcode. Chemical inventory and ERP imports often arrive as CSV columns of CAS numbers with inconsistent hyphenation; strip or keep hyphens as you like, call validate on each row, and quarantine failures instead of loading silent bad keys.

SDS and regulatory document pipelines extract CAS strings from free text; recomputing the check digit filters OCR noise and partial captures before enrichment against a commercial registry. Product teams that already expose general Luhn or barcode check tools should still use this CAS-specific capability for chemistry fields so weights, length bounds, and hyphen formatting match the domain.

Do not treat a passing CAS check digit as proof that the substance is correctly identified, approved for use, or present in any official registry — it only proves the digit string is consistent under the CAS RN check algorithm.

Audit CAS columns in CSV imports

Batch-validate every CAS RN in a partner or ERP export and quarantine rows whose check digit no longer matches the recomputed expected value.

What is a CAS Registry Number check digit?

It is the final single digit of a CAS RN, computed so that a right-to-left weighted sum of the preceding digits modulo ten equals that digit, catching many single-digit typing errors.

What happens with letters or bad hyphens?

Provide digits 0-9 and optional single hyphens only; failed validation tasks are not billed.

Is the CAS number check digit tool free?

The browser tool is free and runs locally.

Does a valid check digit mean the substance exists?

No. The tool does not search the CAS registry or turn a name into a number. A passing check digit only shows that the digit string is well formed under the published rule.

Can I check CAS numbers with a Luhn validator?

No. Luhn doubles every other digit, while the CAS rule multiplies each digit by an increasing weight counted from the right. A general validator may accept a string that is not a valid CAS number.

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.

POSThttps://api.kit.forhosting.com/enc/cas-number

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.

curl -X POST https://api.kit.forhosting.com/enc/cas-number \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"cas":"7732-18"}'
{
  "cas": "7732-18"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "enc.cas_number",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

This capability computes the CAS check digit for a payload of preceding digits (with or without the usual hyphens), or validates a full CAS number that already includes the trailing digit, and it reports malformed input instead of silently stripping bad characters. Use it free in the browser or call the KIT API at the published price; both paths run the same deterministic arithmetic with no network lookup and no stored registry data.

How to compute a check digit or validate a full CAS number

Send a cas field that contains digits zero through nine, optionally separated by the standard hyphens. Mode validate expects a complete CAS RN of at least five digits including the trailing check digit (for example 7732-18-5 or 7732185). Spaces around the value are trimmed; other letters, punctuation, or double hyphens are rejected as malformed input with invalid_input so you never accept a silently cleaned value. Mode compute is the default: provide the digits that precede the check digit (for example 7732-18 or 773218), and the engine returns check_digit as a one-character string, with_check as the full digit string including that digit, and formatted as the hyphenated CAS form head-mid-check. The response reports valid true when the recomputed check digit matches the last digit, and always includes check_digit, expected_check_digit, payload without the last digit, and formatted for consistent display. Empty strings, missing cas, invalid mode values, payloads that are too short or too long, and non-digit garbage fail before any weighted sum runs and are not billed. Because the path is pure parse with no clock, random source, or network, the same input always yields the same JSON on the free browser tool and on the API. At $0.002 per successful request you can gate bulk substance imports, form fields, and ETL jobs without negotiating a custom tier. Prefer compute when you assemble a CAS string from known body digits; prefer validate when a user, partner file, or scanned label supplies a full RN and you need a boolean gate before a registry lookup.

Where CAS check digits fit lab, inventory, and compliance workflows

Validate mode at entry blocks the save when valid is false and can show expected_check_digit so the technician corrects the form before the record is written.

Gate CAS fields on lab and inventory forms

When a user types a full CAS RN, call validate mode and block save when valid is false, showing expected_check_digit to fix a single mistype before the record is stored.

Build or repair CAS strings from body digits

From a known payload without the trailing digit, call compute mode and store with_check or formatted so labels and exports always carry a correct check digit.

How do I compute a CAS check digit with this API?

POST with cas set to the digits before the check digit (hyphens optional) and mode compute (or omit mode). The response includes check_digit, with_check, and formatted.

How do I validate a full CAS number?

POST with the full CAS RN (with or without hyphens) and mode validate. The response includes valid, check_digit, expected_check_digit, payload, and formatted.

Read the full KIT documentation →