PHPackages                             atomescrochus/laravel-string-similarities - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. atomescrochus/laravel-string-similarities

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

atomescrochus/laravel-string-similarities
=========================================

Compare two string and get a similarity percentage

2.1.0(3y ago)70160.1k—6%192MITPHPPHP ~7.0 || ~8.0CI failing

Since Jan 8Pushed 3y ago4 watchersCompare

[ Source](https://github.com/atomescrochus/laravel-string-similarities)[ Packagist](https://packagist.org/packages/atomescrochus/laravel-string-similarities)[ Docs](https://github.com/atomescrochus/laravel-string-similarities)[ GitHub Sponsors](https://github.com/jpmurray)[ RSS](/packages/atomescrochus-laravel-string-similarities/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (13)Used By (2)

laravel-string-similarities
===========================

[](#laravel-string-similarities)

[![Latest Stable Version](https://camo.githubusercontent.com/6de45fde612f9c6c8f76e212e2a6b043883b27d5f364370224315ae42079469d/68747470733a2f2f706f7365722e707567782e6f72672f61746f6d657363726f636875732f6c61726176656c2d737472696e672d73696d696c617269746965732f762f737461626c65)](https://packagist.org/packages/atomescrochus/laravel-string-similarities)[![License](https://camo.githubusercontent.com/27ab8e1cbe5fbf994d7dcb0499b651308909fa54809179394499061244fb125b/68747470733a2f2f706f7365722e707567782e6f72672f61746f6d657363726f636875732f6c61726176656c2d737472696e672d73696d696c617269746965732f6c6963656e7365)](https://packagist.org/packages/atomescrochus/laravel-string-similarities)[![Total Downloads](https://camo.githubusercontent.com/858533ca0dd8eb074a8a64bce5623497faeb60a1bef5c2e64b37efcf44498eec/68747470733a2f2f706f7365722e707567782e6f72672f61746f6d657363726f636875732f6c61726176656c2d737472696e672d73696d696c617269746965732f646f776e6c6f616473)](https://packagist.org/packages/atomescrochus/laravel-string-similarities)

Compare two string and get a similarity percentage. Note that I did not write the algorithms myself, see down this document for the full credits.

Some methods are usable in production, some are not, see usage for informations. Pull requests are more than welcomed!

Install
-------

[](#install)

You can install this package via composer:

```
$ composer require atomescrochus/laravel-string-similarities
```

Then you have to install the package' service provider, *unless you are running Laravel &gt;=5.5* (it'll use package auto-discovery) :

```
// config/app.php
'providers' => [
    ...
    Atomescrochus\StringSimilarities\StringSimilaritiesServiceProvider::class,
];
```

Usage
-----

[](#usage)

```
$comparison = new \Atomescrochus\StringSimilarities\Compare();

// the functions returns similarity percentage between strings
$jaroWinkler = $comparison->jaroWinkler('first string', 'second string'); // JaroWinkler comparison
$levenshtein = $comparison->levenshtein('first string', 'second string'); // Levenshtein comparison
$smg = $comparison->smg('first string', 'second string'); // Smith Waterman Gotoh comparison
$similar = $comparison->similarText('first string', 'second string'); // Using "similar_text()"

// This next one will return an array containing the results of all working comparison methods
// plus an array of 'data' that includes the first and second string, and the time in second it took to run all
// comparison. BE AWARE that comparing long string can results in really long compute time!
$all = $comparison->all('first string', 'second string');
```

Change log
----------

[](#change-log)

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

Testing
-------

[](#testing)

HELP NEEDED.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Jean-Philippe Murray](https://github.com/jpmurray/)
- [joshweir over StackOverflow](http://stackoverflow.com/a/38236357/1001942) for pointing me to the solutions and algorithms for the Jaro Winkler and Smith Waterman Gotoh comparison
- [All Contributors](https://github.com/atomescrochus/laravel-string-similarities/graphs/contributors)

License
-------

[](#license)

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

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 94.6% 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 ~211 days

Recently: every ~461 days

Total

11

Last Release

1299d ago

Major Versions

0.0.1 → 1.0.02017-01-08

1.3.3 → 2.0.02020-03-31

PHP version history (2 changes)0.0.1PHP ~7.0

2.1.0PHP ~7.0 || ~8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1550428?v=4)[Jean-Philippe Murray](/maintainers/jpmurray)[@jpmurray](https://github.com/jpmurray)

---

Top Contributors

[![jpmurray](https://avatars.githubusercontent.com/u/1550428?v=4)](https://github.com/jpmurray "jpmurray (53 commits)")[![jbardnz](https://avatars.githubusercontent.com/u/1628446?v=4)](https://github.com/jbardnz "jbardnz (2 commits)")[![dearsina](https://avatars.githubusercontent.com/u/3647339?v=4)](https://github.com/dearsina "dearsina (1 commits)")

---

Tags

algorithmalgorithmslaravellaravel-5-packagelaravel-packagesimilarity-percentagestringcomparisonlevenshteinatomescrochuslaravel-string-similaritiesJaroWinklerSmithWatermanGotoh

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/atomescrochus-laravel-string-similarities/health.svg)

```
[![Health](https://phpackages.com/badges/atomescrochus-laravel-string-similarities/health.svg)](https://phpackages.com/packages/atomescrochus-laravel-string-similarities)
```

###  Alternatives

[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[danielstjules/stringy

A string manipulation library with multibyte support

2.4k26.0M191](/packages/danielstjules-stringy)[edgaras/strsim

Collection of string similarity and distance algorithms in PHP including Levenshtein, Damerau-Levenshtein, Jaro-Winkler, and more

2423.0k](/packages/edgaras-strsim)[coduo/php-to-string

Simple library that converts PHP value into strings

27112.7M10](/packages/coduo-php-to-string)[kwn/number-to-words

Multi language standalone PHP number to words converter. Fully tested, open for extensions and new languages.

4235.0M21](/packages/kwn-number-to-words)[phootwork/lang

Missing PHP language constructs

1224.8M8](/packages/phootwork-lang)

PHPackages © 2026

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