🔒 100% private — runs in your browser, nothing is uploaded

CUPS Validator (Spain)

Validate a Spanish CUPS electricity supply-point code — structure and the two control letters, computed with the exact procedure the official operating procedure P.O. 10.8 writes down (divide by 529, then by 23, map through the 23-letter table). Format only: a pass never proves the supply point exists.

Every Spanish electricity supply point carries a CUPS — Código Universal de Punto de Suministro — a permanent code that survives changes of supplier, contract holder and ownership, printed on every electricity bill. Its anatomy is fixed by operating procedure P.O. 10.8, approved by the Secretary of State for Energy and published in the BOE (BOE-A-2009-19040): the country code ES, a four-digit distributor code assigned by Red Eléctrica de España, twelve digits the distributor assigns freely to the supply point, and two control letters computed from the sixteen digits in between. An optional final pair — a digit and a letter — marks border and metering roles and is not part of the checksum.

Scope note: the verified procedure (P.O. 10.8) governs electricity metering-point codes. Gas CUPS follow a separate specification that this page does not claim. Your input never leaves this page.

Quick answers

How are the CUPS control letters calculated?

By the procedure in P.O. 10.8 §5: form the natural number from the 16 digits (distributor code + supply-point digits), divide it by 529 and take the remainder R0. Divide R0 by 23, giving quotient C and remainder R. The control letters are the table values of C and R, in that order, from the 23-letter equivalence table 0=T, 1=R, 2=W, 3=A, 4=G, 5=M, 6=Y, 7=F, 8=P, 9=D, 10=X, 11=B, 12=N, 13=J, 14=Z, 15=S, 16=Q, 17=V, 18=H, 19=L, 20=C, 21=K, 22=E.

Worked official example: ES 0987 5432 1098 7654 — the 16-digit number mod 529 is 329; 329 = 23×14 + 7; 14 maps to Z and 7 to F, giving the control letters ZF.

What is the structure of a CUPS code?

Per P.O. 10.8 §4.2: two letters for the country (ES for Spain, ISO 3166-1 alpha-2), four digits of distributor code assigned by Red Eléctrica de España, twelve digits assigned by the distributor to the supply point, and two control letters — 20 characters. An optional digit and letter may follow (22 characters): the letter marks the point type, such as F for a border point or P for a principal metering point.

The code is permanent for the supply point: it does not change when the contract holder or the property changes hands.

Does this validator work for gas CUPS?

The algorithm verified here is the electricity procedure, P.O. 10.8, published with the electricity operating procedures in BOE-A-2009-19040. Gas supply-point codes follow a separate specification that has not been verified for this page, so the tool does not claim gas coverage even though the codes look similar.

If your code came from an electricity bill, this is the right procedure. For gas, ask the distributor which specification the code follows.

How to use

  1. Paste the CUPS exactly as it appears on the bill or contract. Spaces and hyphens are ignored; letters may be lower case.
  2. Read the verdict: the tool checks the ES structure, the 16 digits, and recomputes the two control letters with the P.O. 10.8 procedure.
  3. If the optional two-character suffix is present (a digit and a letter), it is reported separately — it does not take part in the control calculation.

About this tool

The control-letter procedure is unlike the Luhn family. Take the sixteen digits as one large number, divide by 529 and keep the remainder; divide that remainder by 23, keeping quotient and remainder; then map both numbers through a 23-letter table (0=T, 1=R, 2=W, … 22=E). The official document even works an example — ES 0987 5432 1098 7654 takes the letters ZF — and this validator reproduces that example exactly, which is the strongest quick evidence that an implementation matches the specification rather than a blog’s memory of it.

The scope limit matters as much as the algorithm: P.O. 10.8 is the electricity metering-point procedure. Gas supply points use CUPS-shaped codes under their own specification, which this page has not verified and does not claim. And as always here, a pass means the code is well-formed — assignment and activity are the distributor’s records, not a checksum’s business. Your input stays on this device.

How it works

Why divide by 529 and then by 23? Because 529 is 23². One division by 529 leaves a remainder under 529, which is exactly the range a pair of base-23 digits covers (23×23 = 529) — so the quotient-and-remainder split of that remainder yields two clean base-23 digits, and each maps to one letter. The two control letters therefore encode the number’s value modulo 529, a compact residue checksum wearing an alphabetic coat.

The letter table is the same 23-letter set Spain uses for its identity-card checksum (DNI), in the same order — a deliberate reuse of a table Spanish administrators already knew. Reuse cuts both ways: it makes the scheme easy to implement consistently, and easy to implement from memory wrongly, which is why this page was built from the BOE text and tested against the BOE’s own worked example rather than against other websites.

A residue checksum detects transcription errors statistically, not perfectly: roughly 1 in 529 random corruptions lands on another valid residue. That is the honest strength of every two-character check — strong against typos, silent about existence.

What this tool can’t do

Whether the supply point exists or is active. A code can be perfectly formed and still never have been assigned — and this check says nothing about who a supply point belongs to, or which contract is attached to it. Assignment and activity live in the distributor’s records, not in the code.

Worked examples

The BOE’s own worked example: ES0987543210987654ZF: the sixteen digits divided by 529 leave 329; 329 split by 23 gives quotient 14 (Z) and remainder 7 (F). The validator reproduces ZF and passes the code — the specification’s example, not a third party’s.

One control letter mistyped: ES0987543210987654ZA keeps the same digits but ends in A. The recomputed letters are ZF, so the code fails with the expected pair named — the fastest way to spot a copying error on a bill.

A code with the metering suffix: A 22-character CUPS ending in a digit and the letter P validates on its first 20 characters and reports the suffix separately: P marks a principal metering point, and the suffix never enters the control calculation.

Quick reference

SegmentContentRule (P.O. 10.8)
LL (2 letters)Country code, ISO 3166-1 alpha-2 — ES§4.2
DDDD (4 digits)Distributor code, assigned by Red Eléctrica de España§4.2
CCCC CCCC CCCC (12 digits)Supply-point number, assigned by the distributor§4.2
EE (2 letters)Control letters: (16 digits mod 529), split by 23, mapped via the 23-letter table§5
NT (optional)Digit (optional) + point-type letter (F/P/R/C/X/Y/Z)§4.2

Source: BOE-A-2009-19040, P.O. 10.8 (official BOE PDF, pp. 101321–101323). Verified 28 November 2026.

Frequently asked questions

Can the tool check whether my CUPS is active?

No. It validates structure and control letters only. Whether the supply point is active, and which distributor and contract attach to it, are records held by the distributor and the system operator.

Why does the code on my bill have two extra characters?

The optional suffix: a digit (not mandatory) and a letter marking the point’s role — F border point, P principal metering point, R redundant, C check, X/Y/Z recorders, in the procedure’s terms. The suffix is not part of the control-letter calculation.

Is my CUPS stored or sent anywhere?

No. Validation runs in your browser; the code is never placed in the URL, stored, or transmitted.

Sources and verification

Structure and control-letter algorithm: Resolución de 16 de noviembre de 2009 (BOE-A-2009-19040), operating procedure P.O. 10.8 §§4.2 and 5, read in the official BOE PDF including the equivalence table and the worked ZF example, which was re-computed by hand during verification. Verified 28 November 2026.

📦 Embed this tool on your site

<iframe src="https://verystep.com/embed/cups-validator/" title="CUPS Validator (Spain)" width="100%" height="520" loading="lazy" style="border:0"></iframe>

Free to use. The embed shows a small "Powered by Verystep" link.

First time embedding? Read the step-by-step guide →

More free tools