
Codice fiscale in TypeScript
Marketto/codice-fiscale-utils
codice-fiscale-utils is a TypeScript library that generates, decodes and validates the Italian codice fiscale, omocodia included, and works in both Node.js and the browser.

Licence checked on 25/10/2026. Stars and last activity recorded on GitHub on the same date.
Overview
The library offers four families of tools: a parser to encode and decode a codice fiscale, generators of regular-expression patterns, validators, and a validator that checks a codice fiscale against personal data (last name, first name, birth date and place, gender). It also handles omocodia cases.
The README states that a Belfiore connector is required for birthplaces: one with an embedded dataset, a JSON one, or your own built on the provided abstract class. The project is MIT licensed; the lists of municipalities and countries rely on open datasets under CC BY licenses.
Highlights
- The FAQ points out that a plain RegExp checks neither the consistency between birth date and place nor the check character; the library does.
- Omocodia handled by a dedicated class, integrated into the Parser, Validator and Pattern (cfDeomocode, cfOmocode, cfOmocodeId).
- Full encoding and decoding: encodeCf builds the code from the data, cfDecode recovers name codes, date, gender and place.
- Consistency validator (CFMismatchValidator) with match and mismatch methods for last name, first name, date, gender and birthplace.
- Declared compatibility with Node.js, Chrome, Firefox and Edge.
Who it is for
For JavaScript or TypeScript developers who need to check or produce a codice fiscale, in a Node.js service or a browser-side web application.
Installation
Install with npm. The README also requires a BelfioreConnector, to be chosen from two @marketto packages (embedded dataset, or JSON list) or written yourself; the library is then instantiated with that connector. Inclusion through script tags is also described.
Commands
Read the project README before running these commands.
npm i -s @marketto/codice-fiscale-utilsPoints of attention
- The README states that a Belfiore connector is required; it is installed separately, as a distinct @marketto package.
- The two-digit year is ambiguous: the parser picks 20xx if the date would be valid within the last 100 years, otherwise 19xx.
- Place-related functions (placeToCf, cfDecode, place validators) are asynchronous and used with await.
Can an agent use it?
No SKILL.md, AGENTS.md, CLAUDE.md, Cursor rules or MCP server found at the root or in the README. This is a JavaScript/TypeScript library to integrate into code.
Likes and comments
No account needed: one like per browser, which you can remove. Comments are published after review.
This project is hosted by its author: your comments are about this page, not the code. To report an issue with the project, use its repository.
Loading likes and comments…
Comments
Leave a comment
Other skills
The whole catalogue

Codice fiscale in Python
fabiocaccamo/python-codicefiscale
Encodes, decodes and validates the Italian codice fiscale, in Python.

Complete design system
design-system-builder
One interactive multilingual page plus the design.md file your coding agents read.
A custom skill for your trade?
We also write private skills, in your name. Let's talk about it on a 30-minute call.