PHPackages                             rechtlogisch/ust-id - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. rechtlogisch/ust-id

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

rechtlogisch/ust-id
===================

Validates the German VAT-ID (Umsatzsteuer-Identifikationsnummer)

v1.2.0(10mo ago)011MITPHPPHP ^8.2CI passing

Since Jul 9Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/rechtlogisch/ust-id)[ Packagist](https://packagist.org/packages/rechtlogisch/ust-id)[ Docs](https://github.com/rechtlogisch/ust-id)[ RSS](/packages/rechtlogisch-ust-id/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (4)Used By (0)

[![Recht logisch USt-ID banner image](rechtlogisch-ust-id-banner.png)](rechtlogisch-ust-id-banner.png)

[![Latest Version on Packagist](https://camo.githubusercontent.com/962e35f82988b6532aa8953c428dbd9444d94aa501c87927a6cd8377d3f9c769/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72656368746c6f67697363682f7573742d69642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rechtlogisch/ust-id)[![Tests](https://github.com/rechtlogisch/ust-id/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/rechtlogisch/ust-id/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/2e2618eec99e9b49c625f58448c84f64dcff7d740877a0c52119a53302693767/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72656368746c6f67697363682f7573742d69642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rechtlogisch/ust-id)

ust-id
======

[](#ust-id)

> Validates the German VAT-ID (Umsatzsteuer-Identifikationsnummer, short: USt-ID)

Check digit (last digit) is validated based on [ISO/IEC 7064, MOD 11,10](https://www.iso.org/standard/31531.html) as documented within the meanwhile repealed "Datenträger-Verordnung über die Abgabe Zusammenfassender Meldungen – ZMDV" dated 13.05.1993 ([BGBl. I S. 736](https://www.bgbl.de/xaver/bgbl/start.xav?start=%2F%2F*%5B%40attr_id%3D%27bgbl193s0726.pdf%27%5D#__bgbl__%2F%2F*%5B%40attr_id%3D%27bgbl193s0726.pdf%27%5D__1720528216746)).

Note

This package validates solely the syntax and check digit of the provided input. It does not confirm, that the provided USt-ID was assigned to an entrepreneur. Please use the official [VIES](https://ec.europa.eu/taxation_customs/vies/) service for that.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require rechtlogisch/ust-id
```

Usage
-----

[](#usage)

```
isUstIdValid('DE123456788'); // => true
```

or

```
use Rechtlogisch\UstId\UstId;

(new UstId('DE123456788'))
    ->validate() // ValidationResult::class
    ->isValid(); // => true
```

Validation errors
-----------------

[](#validation-errors)

You can get a list of errors explaining why the provided input is invalid. The `validate()` method returns a DTO with a `getErrors()` method.

Note

The keys of `getErrors()` hold the stringified reference to the exception class. You can check for a particular error by comparing to the ::class constant. For example: `Rechtlogisch\UstId\Exceptions\InvalidUstIdLength::class`.

```
validateUstId('DE12345678')->getErrors();
// [
//   'Rechtlogisch\UstId\Exceptions\InvalidUstIdLength'
//    => 'USt-ID must be 11 characters long. Provided USt-ID is: 10 characters long.',
// ]
```

or

```
use Rechtlogisch\UstId\UstId;

(new UstId('DE12345678'))
    ->validate()
    ->getErrors();
// [
//   'Rechtlogisch\UstId\Exceptions\InvalidUstIdLength'
//    => 'USt-ID must be 11 characters long. Provided USt-ID is: 10 characters long.',
// ]
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/rechtlogisch/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover any security-related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Krzysztof Tomasz Zembrowski](https://github.com/zembrowski)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance63

Regular maintenance activity

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~171 days

Total

3

Last Release

328d ago

PHP version history (2 changes)v1.0.0PHP ^8.1

v1.2.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f60f360e9d79540ea00427585d1b0063f2c1125ef8d22be6939428ffb68ccc1?d=identicon)[rechtlogisch](/maintainers/rechtlogisch)

---

Top Contributors

[![zembrowski](https://avatars.githubusercontent.com/u/2451083?v=4)](https://github.com/zembrowski "zembrowski (14 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

germanyphpust-idvalidatevat-idVAT IDgermanyrechtlogischust-idumsatzsteuer-identifikationsnummer

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rechtlogisch-ust-id/health.svg)

```
[![Health](https://phpackages.com/badges/rechtlogisch-ust-id/health.svg)](https://phpackages.com/packages/rechtlogisch-ust-id)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)[xemlock/htmlpurifier-html5

HTML5 support for HTML Purifier

1052.9M11](/packages/xemlock-htmlpurifier-html5)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
