# Diff::LCS

> Ruby library for diffs using the longest common subsequence algorithm

Source: https://talira.ai/catalog/diff-lcs-4e4dvp1t
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / text / diffing](https://talira.ai/categories/libraries/text/diffing), [languages / ruby](https://talira.ai/categories/languages/ruby)
- Licence: MIT OR Artistic-1.0-Perl OR GPL-2.0-or-later[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Austin Ziegler](https://talira.ai/orgs/austin-ziegler.md)

Diff::LCS (the diff-lcs gem) computes the differences between two Ruby Enumerable sequences with the McIlroy-Hunt longest common subsequence algorithm, and includes utilities for a simple HTML diff and a standard diff-like command-line tool. It's adapted from Perl's Algorithm::Diff and maintained by Austin Ziegler. Version 2.0 removed deprecations and requires Ruby 3.2 or later.

## Links

- Website: https://halostatue.github.io/diff-lcs/
- GitHub: https://github.com/halostatue/diff-lcs
- Docs: https://halostatue.github.io/diff-lcs/

## Problems it solves

- compute the difference between two arrays in Ruby
- show a text diff from a Ruby script
- generate an HTML diff in Ruby

## Features

- McIlroy-Hunt LCS diffs of any Enumerable
- HTML diff output
- a standard diff-like command-line tool

## Trust

Overall: 0.46 out of 1.
Signals: maintenance 0.68, adoption 0.50, momentum 0.13, community 0.62, backing 0.30, extensibility 0.00.

- last commit 2 days ago
- 12 commits in the last 90 days
- 317 GitHub stars
- 35 contributors
- accepts sponsorship (Github, Buy Me A Coffee, Ko Fi)
- backed by Austin Ziegler

## Sources

[^1]: https://github.com/halostatue/diff-lcs/blob/main/LICENCE.md (checked 29 Nov 2026)
