Rule · MAJOR
COMMON.LEI_CHECK_DIGITS
Legal Entity Identifier format and check digits (ISO 17442, ISO/IEC 7064 MOD 97-10)
- Citation
- Annex I, Part A, point 5, Part B, point 5, Part C, point 5, Annex II, Part A, point 5, Annex III, Part A, point 5 MiCAR
- Canonical form
- Anhang I Teil A Nr. 5, Teil B Nr. 5, Teil C Nr. 5, Anhang II Teil A Nr. 5, Anhang III Teil A Nr. 5 MiCAR
- Runs for
- Annex I · other crypto-assets; Annex II · asset-referenced tokens; Annex III · e-money tokens
- Severity if open
- MAJOR
- Section key
- all sections; anchored to
issuer - Minimum words
- 0
- Listed terms (English)
- none
- Listed terms (German)
- none
- Package version
- 1.3.0, built from source that may include unreleased changes
- Source
- rules/common.py
How the status is set
- Missing: no section that reads LEIs on its own (below) holds an LEI-shaped code (18 upper-case letters or digits and two check digits) as written, and no section
issuer,offerorortrading_platform_operatorhas text other than a placeholder. A malformed code, or an LEI-shaped code elsewhere that fails its check digits (below), is named in the finding but does not change this status. - Review: an LEI-shaped code that is read fails the ISO/IEC 7064 MOD 97-10 check digits; an LEI-like code that is read is malformed; or no section that reads LEIs on its own holds an LEI-shaped code as written while a party section has text, since point 5 allows another identifier required pursuant to applicable national law in place of the LEI. A section reads LEIs on its own if it is
issuer,offerorortrading_platform_operator, names an LEI label (LEI or LEIs, legal entity identifier or ID, Rechtsträgerkennung, in any case, also split by hyphens, dashes or line ends) or holds an LEI-shaped code with a letter. A draft with such a section, or whose file text names a label or holds such a code, is read in all its text: every section and, for a PDF, DOCX, Markdown, XHTML or HTML file, the text outside the sections (headings, tables, text boxes, headers and footers, text in no section). A DOCX, PDF, XHTML or HTML file that holds text a reader cannot see is also read as a reader sees it, without that text (see the limitations), and a code that this reading alone finds malformed or with failing check digits is named as standing in the text as a reader sees it. Each text is read as written and, where markup or a character reference changes it, as a Markdown or HTML renderer shows it (comments, tags, emphasis, code and link markup removed, and other references replaced by their characters). There every LEI-shaped code, a 20-digit number included, has its check digits checked, and every LEI-like code counts, wherever it stands: one run of 16 to 24 letters and digits of any script that holds a digit or is in ASCII capitals, or a longer run with a digit that a glued LEI (up to 28 characters) or a glued word explains; groups joined by one to three spaces, hyphens, dashes or line ends, with at most one hyphen or dash and one line end between two groups, and by any number of invisible characters (zero-width spaces, bidirectional marks and other format characters), that together hold at least 16 and hold a digit or all have one length; or two pieces with letters and digits of a code that a table cell wraps from a line that names an LEI label, or the line before one, onto the next line. A word of letters only with a lower-case letter or a letter outside ASCII joins only beside a group of its length with a digit. An LEI-like code is malformed unless it is one run that is LEI-shaped as written. So a code is malformed if it has 16 to 19 or 21 to 24 characters, is in lower case, has a letter where a check digit belongs or a character outside ASCII, is glued to LEI or to a word, is split into groups, or is wrapped in a table cell. - Pass: a section that reads LEIs on its own holds an LEI-shaped code as written, every LEI-shaped code that is read, as written or as shown, has valid check digits and no LEI-like code is malformed. No registry is asked.
Legal basis
Annex I, Part A, point 5, Part B, point 5, Part C, point 5, Annex II, Part A, point 5, Annex III, Part A, point 5 MiCAR
Checked on 2026-10-27 against the Official Journal text in English and German: point 5 of Annex I Parts A, B and C and of Annex II and III Part A names the legal entity identifier or another identifier required pursuant to applicable national law, and Art. 2(1)(b) and (c) of Implementing Regulation (EU) 2024/2984 ask for the LEI where available.
Synthetic examples
Each example is linted when this page is generated. The build fails if a result differs.
Without an LEI there are no check digits to verify, and no party section says who the parties are, so the rule fails closed.
{
"title": "Synthetic rule example",
"type": "other",
"sections": {
"summary": "Synthetic summary of a fictional token."
}
}Point 5 of each party Part allows another identifier required pursuant to applicable national law in place of the LEI, so a reviewer checks which one the draft gives.
{
"title": "Synthetic rule example",
"type": "other",
"sections": {
"issuer": "Synthetic Issuer AG."
}
}The last two digits do not satisfy ISO/IEC 7064 MOD 97-10, which usually means a typo.
{
"title": "Synthetic rule example",
"type": "other",
"sections": {
"issuer": "Synthetic Issuer AG. LEI: 9999SYNTH0000ZZQ0167."
}
}The offeror section names an LEI and gives a code of 19 characters, one short of an LEI, so the code is malformed. The valid issuer LEI does not let the rule pass.
{
"title": "Synthetic rule example",
"type": "other",
"sections": {
"issuer": "Synthetic Issuer AG, a fictional company. LEI: 9999SYNTH0000ZZQ0166.",
"offeror": "Synthetic Offeror GmbH. LEI: 9999SYNTH0000ZZQ026."
}
}The draft names an LEI, so every section is read, this one too, though it is no party section and names no LEI label. In a PDF, DOCX, Markdown, XHTML or HTML file the text outside the sections is read as well: headings, tables and text in no section.
{
"title": "Synthetic rule example",
"type": "other",
"sections": {
"issuer": "Synthetic Issuer AG, a fictional company. LEI: 9999SYNTH0000ZZQ0166.",
"offer_or_admission": "Synthetic Admission GmbH (9999SYNTH0000ZZQ026) seeks admission to trading."
}
}The code is well formed. The check does not ask a registry whether the LEI exists or belongs to the named entity.
{
"title": "Synthetic rule example",
"type": "other",
"sections": {
"issuer": "Synthetic Issuer AG, a fictional company. LEI: 9999SYNTH0000ZZQ0166."
}
}Limitations
- Reads every section of the draft; findings are anchored to the
issuersection. - Works offline on the characters of each code. It does not confirm that an LEI is registered, current or held by the entity the draft names.
- Status and severity are fixed by the rule. A draft cannot waive or downgrade them.
- Does not recognise the other identifiers that point 5 allows in place of the LEI, so a draft without any LEI goes to review once a party section has text. Once the draft gives one LEI, a party section without an LEI of its own does not change the result.
- Reads the sections and, for a document file, the text its loader extracts. Text the loaders do not extract is not seen: in a DOCX, footnotes, endnotes, comments, deleted text as Word writes it (
w:delText), field codes and text in charts, SmartArt or images; in a PDF, text that is not extracted (images, scans, annotations, form fields); in XHTML or HTML, the head, scripts, styles and attribute values, and CDATA sections, which the HTML parser drops (a code inside<![CDATA[…]]>, or the part of a code inside one, is not read); in a JSON draft, anything outside its sections, such as the title. An entity that an XHTML or HTML document declares in its own DTD is not expanded, so a code given through one is not read. A DOCX, PDF, XHTML or HTML file is read twice: with all its text, hidden text included, and as a reader sees it, without the text that the loader finds a reader cannot see. A code that is malformed or fails its check digits in either reading keeps the rule from passing, so hidden text that the second reading leaves out cannot complete a code the document shows malformed, split it into groups that are no LEI-like code (but see below for a separator under 1 pt), or glue it to other text. Hidden text that still takes up its room on the page (a DOCX run laid out white or under 1 pt, all hidden PDF text, XHTML or HTML text thatvisibilityhides) leaves a gap where it stands, so it cannot join two groups the page shows apart into one code either; text left out of the page (w:vanish, deleted or moved-away text, the other XHTML and HTML hiding) leaves none. Where the second reading fails for any reason, it is dropped and the file is read as without it. The second reading leaves out exactly this: in a DOCX, text inside a tracked deletion (w:del) or moved away under tracked changes (w:moveFrom), and a run, with everything in it such as a text box, that is hidden (w:vanish), set in a font under 1 pt (w:sz) or with its characters scaled to under 1 pt wide (w:sztimes the character scalew:w; 10 pt where no size is set), or white or nearly white (w:color, each colour channel at least 95 %) with no background behind it. A background is a highlight other than none and white (w:highlight), run shading, or the shading of the table cell the run stands in (the cell's ownw:shd, else its table style's; only where neither sets one, that of the cell around a nested table, so a nested cell's own shading counts even where it is white or has no fill): the fill of clear or patterned shading (w:shd) or the colour of solid shading, in which automatic stands for black; nil, no fill and white or nearly white are none. A theme colour (w:themeColor,w:themeFill) is taken from the document's theme with its tint or shade (without a theme, light 1 is white and dark 1 black). Each property counts as set on the run, else in its character style, else in its paragraph's style, else in the run properties of its table's style, else in the document defaults (with the default paragraph and table styles, and the styles each is based on); the table style counts after the paragraph style as well, and the run is hidden if either order hides it.w:vanishset in any of these styles hides the run unless the run sets it off itself. A paragraph whose mark is deleted, moved away or set tow:vanishruns on into the next one. What stays joins as Word shows it with every tracked change accepted, so a code split between a run and a content control, a tracked insertion, a field result or a smart tag reads as one, in every paragraph, table, header, footer and section. In a PDF, text drawn in text render mode 3 or 7; text whose render mode paints only in white or nearly white (a colour set withg,rgork, their stroke forms, orscandscnin a device colour space, or in a space that the/ColorSpaceresources name for one, an ICC-based space by its number of components or a calibrated grey or RGB space; each grey or RGB component at least 0.95, each CMYK one at most 0.05); text whose glyphs are under 1 pt high or wide on the page (its size, for the width times the horizontal scalingTz, scaled by the text matrix, the current transformation matrix and any form XObject's matrix, the height measured across the baseline); and text in marked content tagged/OCor in a form XObject with an/OCentry whose optional content (layer) the document's default configuration turns off (by its/OFFarray, or its/BaseState /OFFwithout its/ONarray, and for a membership dictionary by its visibility expression or its policy). The state is saved before every form XObject and restored after it, so nothing the form's content sets outlasts the form, also where its matrix does not hold six numbers (which leaves the matrix as it was). An operator whose operands this reading cannot read (a number too large for a float in a colour,cm,TforTr) leaves the reading as it was; where pypdf cannot read an operand itself (a number too large for a float forTz,Tw,TL,TdorTm, among others), the file cannot be read, as before. In XHTML or HTML,<noscript>and the content of<iframe>,<canvas>,<object>,<video>,<audio>and<embed>; inside an<svg>, the elements a drawing does not render where they stand (<desc>,<title>,<metadata>,<defs>,<symbol>,<clipPath>,<mask>,<pattern>,<marker>, the gradients,<filter>,<style>,<script>); an element that itsstyleattribute sets todisplay:none, or, inside an<svg>, whosedisplayattribute is none where thatstyleattribute sets no display; where neither sets a display, an element with thehiddenattribute (other thanuntil-found), one that the browser's own style sheet hides (<area>,<base>,<basefont>,<datalist>,<link>,<meta>,<noembed>,<noframes>,<param>,<rp>,<title>) and a<dialog>without theopenattribute, each with all its content; all but the first<summary>of a<details>without theopenattribute; the content of an element set tocontent-visibility:hidden, or withhidden="until-found"where itsstyleattribute sets nocontent-visibility; and the text of an element set tovisibility:hiddenorcollapse(inside an<svg>also by itsvisibilityattribute, where thestyleattribute sets none), or inside one withoutvisibility:visibleof its own, which counts as a space because it keeps its place. Thestyleattribute is read as CSS reads it, comments, strings and escapes included: a declaration with an invalid value is dropped, and so is one whose value uses a function such asvar(), which CSS applies; the last valid one counts and one marked!importantwins over those without the mark. Hidden text that is not told apart is still read as if shown, so a fragment there can complete a code the document shows malformed, or split it into groups that are no LEI-like code, and the rule passes unless something else keeps it from passing. Among it: in a DOCX, text in a font of 1 pt or more whose characters are 1 pt wide or more, in the colour of a coloured background (such as black on black shading), hidden by conditional table formatting (w:tblStylePr), condensed by its character spacing, raised or lowered out of view, in a complex-script run whose size (w:szCs) is tiny, a run withw:specVanish, aw:tin the code of a complex field, behind an image or a shape or off the page; in a PDF, text in a font of 1 pt or more (also where anExtGStatesets it under 1 pt), under other content (such as a white filled rectangle), outside the clipping path or off the page, transparent text, text in a pattern, white text in another colour space (Lab, separation, DeviceN, indexed), and optional content that only another configuration or the usage settings turn off; in XHTML or HTML, text that a style sheet hides (a<style>element or linked CSS, through a class or any other selector), text that other properties hide (opacity, colour, font size, position, clipping, transforms), adisplayorvisibilitygiven throughvar(), SVG text without fill or with a zero opacity, the options of a<select>other than the one it shows, MathML annotations and text that scripts hide. A group shown with fewer than 16 characters is no LEI-like code (below), so hidden text that completes such a group, or that hides every other character of a valid code, leaves the second reading no code to name. Text the second reading leaves out that a reader does see, and a gap that hidden text taking next to no room leaves inside a valid code, can only add a review, which fails safe. Among them: in a DOCX, white text on paragraph or table shading, on shading that conditional table formatting sets, or on a coloured page, image or shape, white text on patterned run shading whose fill is white or automatic but whose pattern colour darkens it, white text in a nested table cell whose own shading sets no fill inside a shaded cell, a run whose paragraph style and character style both setw:vanish, which Word shows, a run that its table style hides in only one of the two orders tried, where Word uses the other, a complex-script run under 1 pt byw:szbut not byw:szCs, by which Word sizes it, and a run under 1 pt inside a valid code; in a PDF, white text on a coloured background and glyphs under 1 pt wide inside a valid code; in XHTML or HTML, an element that a style sheet shows although thehiddenattribute, the browser's own style sheet or a closed<dialog>hides it, fallback content that a browser shows (an<object>whose resource cannot be shown, a<noscript>or<canvas>where scripts are off), and SVG text in<defs>that a<use>element draws. Inside a malformed code, such a gap can instead hide the code: a separator under 1 pt (a DOCX run in a font under 1 pt, PDF glyphs under 1 pt), which the page shows no gap for, can split it into groups that are no LEI-like code, such as a word of letters only beside a group of another length (a/in a half-point font afterhwupkrinhwupkr0mpou8fgxbt394), so no reading names the code and the rule passes, as in 1.2.1. The section text of a DOCX holds only the runs and hyperlinks that stand directly in a paragraph of the body, so it leaves out text in a tracked insertion or at a move's new place (w:moveTo), a content control, a field result (w:fldSimple), a smart tag, custom XML or a text box. A valid code that such text completes with four characters or fewer reads as malformed in the section text, and the rule goes to review, which fails safe; with five or more, what stays in the section text is no LEI-like code and the rule passes. That holds in a section the draft's regime drops too: the loader drops the sections of the other regimes (an ART draft its EMT, crypto-asset and first-page statement sections, an EMT draft its ART and crypto-asset sections, any other draft its ART and EMT sections, whether the regime is inferred or given with--type) but keeps the text of each for the rule, as the section text reads it, so a code that a dropped section shows malformed goes to review whatever the regime (a code there never counts as found), and the second reading covers a dropped section as it covers the rest of the file. A malformed code that is no LEI-like code in the text as written or as shown is not seen either: one run of fewer than 16 letters and digits, or of more than 24 (28 for one with a digit after a glued LEI) that no glued word explains, as when a code has lost or gained five or more characters or has digits glued to it; groups that together hold fewer than 16; a run of letters only with a lower-case letter or a letter outside ASCII, which reads as a word; groups split by any other character, such as a full stop, a slash, a comma, a bullet or an underscore that a renderer shows, by more than three characters other than invisible ones, or by two hyphens or dashes or two line ends (a blank line); a code split into groups where such a word stands beside no group of its length with a digit; groups in ASCII capitals without a digit and of different lengths; or a code that a table cell wraps where a piece holds no letter or no digit or is split into groups, where neither line names an LEI label (as in a PDF party table whose LEI label stands only in its header row, above the row in which the code wraps), where other lines stand between its pieces, or where the code wraps over more than two lines. Markup inside text that a renderer does not show, such as an HTML comment or a link target, is read as written only. Every LEI-like code in a draft that reads LEIs counts, wherever it stands, so an IBAN, a long number in groups, a placeholder such as XXXXXXXXXXXXXXXXXXXX, a reference number of 16 to 24 letters and digits, an address or a heading in capitals with a digit in it, a word of 16 to 24 ASCII capitals in a heading or in text, numbers in neighbouring table cells that join, two codes with letters and digits on a line that names an LEI label and the next line, or a valid LEI glued to LEI or to a word or split into groups (also by markup, as written) gives Review too, which fails safe. A code that the file text and a section quote with different neighbours is named twice, and once more where the file's text as a reader sees it quotes it with other neighbours.
Disagree with this rule, or missing one? Propose a rule change.