# JavaScript fuzzy search libraries

JavaScript fuzzy search libraries match a query against a list of strings or objects even when the spelling differs. Each library scores how closely the query's characters appear in an item and returns the items ranked by that score. These libraries run the command palettes, autocomplete boxes, and quick filters in web apps and code editors.

## Popularity

| Library | Monthly downloads | Stars | Last release | License |
| --- | --- | --- | --- | --- |
| [fuzzysort](#fuzzysort) | 77.8M | 4.4K | Aug 2026 | MIT |
| [fuse.js](#fuse-js) | 76.1M | 20.5K | Jul 2026 | Apache-2.0 |
| [@tanstack/match-sorter-utils](#tanstack-match-sorter-utils) | 33.0M | Not on GitHub | Oct 2026 | MIT |
| [fuzzy](#fuzzy) | 31.6M | Not on GitHub | Oct 2016 | MIT |
| [match-sorter](#match-sorter) | 18.5M | Not on GitHub | Nov 2026 | MIT |
| [fzf](#fzf-for-javascript) | 18.3M | 956 | Apr 2023 | BSD-3-Clause |
| [fast-fuzzy](#fast-fuzzy) | 8.4M | 388 | Nov 2022 | ISC |
| [microfuzz](#nozbe-microfuzz) | 3.6M | Not on GitHub | Jul 2023 | MIT |

Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

[fuzzysort](#fuzzysort) has the most monthly downloads in this comparison, at 77.8M.

## Capabilities

| Library | Reusable collection preprocessing | Multiple fields per item |
| --- | --- | --- |
| [fuzzysort](#fuzzysort) | Yes | Yes |
| [fuse.js](#fuse-js) | Yes | Yes |
| [@tanstack/match-sorter-utils](#tanstack-match-sorter-utils) | No | Yes |
| [fuzzy](#fuzzy) | No | No |
| [match-sorter](#match-sorter) | No | Yes |
| [fzf](#fzf-for-javascript) | Yes | No |
| [fast-fuzzy](#fast-fuzzy) | Yes | Yes |
| [microfuzz](#nozbe-microfuzz) | Yes | Yes |

## Libraries

### fuzzysort

[GitHub](https://github.com/farzher/fuzzysort) · [npm](https://www.npmjs.com/package/fuzzysort) · [Docs](https://api.github.com/repos/farzher/fuzzysort/contents/README.md)

Ranks fuzzy matches across strings or selected object fields.

- Downloads / mo: 77.8M
- Stars: 4.4K
- Last release: 4.0.2
- License: MIT
- Capabilities: [From the fuzzysort docs](https://api.github.com/repos/farzher/fuzzysort/contents/README.md)

**Strengths**

- **Combines nested fields and scoring.** Search nested fields and adjust ranking with scoreFn.
- **Normalizes accents and lookalike characters.** Searches strip diacritics and remap common character variants.

**Watch out for**

- **Cloned results lose getter behavior.** Use fuzzysort.score and fuzzysort.highlight for results passed through structured cloning.
- **Current release uses ES modules.** Use ES module imports when adopting the current major release.

```sh
npm install fuzzysort
```

**anomalyco/opencode** (203.6K stars)

[anomalyco/opencode](https://github.com/anomalyco/opencode) 

```javascript
function search(index: ReturnType<typeof emptyIndex>, input: FileSystem.FindInput) {
  const items =
    input.type === "file"
      ? Array.from(index.files.values())
      : input.type === "directory"
        ? Array.from(index.directories.values())
        : [...index.files.values(), ...index.directories.values()]
  const result = fuzzysort.go(input.query, items, { limit: input.limit ?? 50 })
  // Targets are owned by the current location index. The only global fuzzysort
  // state left is its query cache, which must not retain every query forever.
  fuzzysort.cleanup()
  return result.map((item) => {
    const relative = item.target
    const type = relative.endsWith(path.sep) ? ("directory" as const) : ("file" as const)
    return FileSystem.Entry.make({
      path: RelativePath.make(relative),
      type,
    })
  })
}

```

[packages/core/src/filesystem/search.ts](https://github.com/anomalyco/opencode/blob/f6e0c2d0833ffe772035f221fed923e1cd5fb408/packages/core/src/filesystem/search.ts#L31-L50) · [More projects using fuzzysort →](https://dashboard.exa.ai/playground/search?q=Projects%20using%20fuzzysort%20for%20fuzzy%20matching%20command%20palettes%20file%20pickers%20or%20object%20lists&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
import fuzzysort from 'fuzzysort'

const results = fuzzysort.go('mr', ['Mercury', 'Mars'])

```

From [README.md](https://api.github.com/repos/farzher/fuzzysort/contents/README.md)

### fuse.js

[GitHub](https://github.com/krisk/Fuse) · [npm](https://www.npmjs.com/package/fuse.js) · [Docs](https://api.github.com/repos/krisk/Fuse/contents/README.md)

Searches text and object fields using approximate string matching.

- Downloads / mo: 76.1M
- Stars: 20.5K
- Last release: 7.5.0
- License: Apache-2.0
- Capabilities: [From the fuse.js docs](https://api.github.com/repos/krisk/Fuse/contents/README.md)

**Strengths**

- **Weights different text fields.** Give title matches more weight than description matches.
- **Moves matching into browser workers.** Use FuseWorker for searches that return promises.

**Watch out for**

- **Penalizes matches far into text.** Set ignoreLocation to match text regardless of its starting position.
- **Worker mode excludes token search.** Use the standard Fuse class when enabling useTokenSearch.

```sh
npm install fuse.js
```

**mantinedev/mantine** (31.9K stars)

[mantinedev/mantine](https://github.com/mantinedev/mantine) 

```javascript
const fuzzySearchFilter: SpotlightFilterFunction = (query, actions) => {
  if (!query.trim()) {
    return actions;
  }

  const flatActions = actions.reduce<any[]>((acc, item) => {
    if ('actions' in item) {
      return [...acc, ...item.actions.map((action) => ({ ...action, group: item.group }))];
    }
    return [...acc, item];
  }, []);

  const fuse = new Fuse(flatActions, {
    keys: ['label', 'description', 'keywords'],
    threshold: 0.3,
    minMatchCharLength: 1,
  });

  const results = fuse.search(query).map((result) => result.item);

  const groups: Record<string, any> = {};
  const result: any[] = [];

  results.forEach((action) => {
    if (action.group) {
      if (!groups[action.group]) {
        groups[action.group] = { pushed: false, data: { group: action.group, actions: [] } };
      }
      groups[action.group].data.actions.push(action);
      if (!groups[action.group].pushed) {
        groups[action.group].pushed = true;
        result.push(groups[action.group].data);
      }
    } else {
      result.push(action);
    }
  });

  return result;
};

```

[apps/mantine.dev/src/components/Search/Search.tsx](https://github.com/mantinedev/mantine/blob/3646de9f0fe83eaf2946154e6385bd82eb15c243/apps/mantine.dev/src/components/Search/Search.tsx#L9-L48) · [More projects using fuse.js →](https://dashboard.exa.ai/playground/search?q=Projects%20using%20fuse.js%20for%20fuzzy%20matching%20command%20palettes%20file%20pickers%20or%20object%20lists&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
import Fuse from 'fuse.js'

const fuse = new Fuse([{ title: 'Mercury' }], { keys: ['title'] })
const results = fuse.search('mercury')

```

From [fuse.d.ts](https://cdn.jsdelivr.net/npm/fuse.js@7.5.0/dist/fuse.d.ts)

### @tanstack/match-sorter-utils

[GitHub](https://github.com/TanStack/table) · [npm](https://www.npmjs.com/package/@tanstack/match-sorter-utils) · [Docs](https://api.github.com/repos/TanStack/table/contents/packages/match-sorter-utils/src/index.ts)

Splits match-sorter's ranking into separate filtering and sorting phases.

- Downloads / mo: 33.0M
- Last release: 9.2.6
- License: MIT
- Capabilities: [From the @tanstack/match-sorter-utils docs](https://api.github.com/repos/TanStack/table/contents/packages/match-sorter-utils/src/index.ts)

**Strengths**

- **Ranks items one at a time.** Call rankItem, then filter on its passed flag and sort on its rank.

**Watch out for**

- **Lower level than match-sorter.** Combine the filter and sort steps in application code.

```sh
npm install @tanstack/match-sorter-utils
```

**KevinVandy/material-react-table** (1.8K stars)

[KevinVandy/material-react-table](https://github.com/KevinVandy/material-react-table) 

```javascript
const fuzzy = <TData extends MRT_RowData>(
  row: Row<TData>,
  columnId: string,
  filterValue: number | string,
  addMeta: (item: RankingInfo) => void,
): boolean => {
  const itemRank = rankItem(
    row.getValue<string | number | null>(columnId),
    filterValue as string,
    {
      threshold: rankings.MATCHES,
    },
  );
  addMeta(itemRank);
  return itemRank.passed;
};
```

[packages/material-react-table/src/fns/filterFns.ts](https://github.com/KevinVandy/material-react-table/blob/60080592eaefd57f53abec383f449fa7d59168a0/packages/material-react-table/src/fns/filterFns.ts) · [More projects using @tanstack/match-sorter-utils →](https://dashboard.exa.ai/playground/search?q=%40tanstack/match-sorter-utils%20GitHub%20projects)

**Quickstart**

```javascript
import { rankItem } from '@tanstack/match-sorter-utils'

const match = rankItem('Mercury', 'mer')

```

From [index.ts](https://api.github.com/repos/TanStack/table/contents/packages/match-sorter-utils/src/index.ts)

### fuzzy

[GitHub](https://github.com/mattyork/fuzzy) · [npm](https://www.npmjs.com/package/fuzzy) · [Docs](https://api.github.com/repos/mattyork/fuzzy/contents/README.md)

Filters a list of strings with a small, standalone fuzzy matcher in the browser or Node.js.

- Downloads / mo: 31.6M
- Last release: 0.1.3
- License: MIT
- Capabilities: [From the fuzzy docs](https://api.github.com/repos/mattyork/fuzzy/contents/README.md)

**Strengths**

- **Marks matched characters.** Pass pre and post strings to wrap each matched character.

```sh
npm install fuzzy
```

**embarklabs/embark** (3.8K stars)

[embarklabs/embark](https://github.com/embarklabs/embark) 

```javascript
export function fuzzySearch(text, list, filter) {
  const fuzzy = require('fuzzy');
  return fuzzy.filter(text, list, {
    extract: filter
  });
}
```

[packages/core/utils/src/index.ts](https://github.com/embarklabs/embark/blob/c7a5c4c36880dd254917e9a1060788ed7763f943/packages/core/utils/src/index.ts) · [More projects using fuzzy →](https://dashboard.exa.ai/playground/search?q=fuzzy%20GitHub%20projects)

**Quickstart**

```javascript
const fuzzy = require('fuzzy')

const results = fuzzy.filter('mr', ['Mercury', 'Mars'])

```

From [README.md](https://api.github.com/repos/mattyork/fuzzy/contents/README.md)

### match-sorter

[GitHub](https://github.com/kentcdodds/match-sorter) · [npm](https://www.npmjs.com/package/match-sorter) · [Docs](https://api.github.com/repos/kentcdodds/match-sorter/contents/README.md)

Sorts an array by best match with deterministic rules.

- Downloads / mo: 18.5M
- Last release: 8.3.1
- License: MIT
- Capabilities: [From the match-sorter docs](https://api.github.com/repos/kentcdodds/match-sorter/contents/README.md)

**Strengths**

- **Ranks exact matches first.** Exact matches rank above prefix matches and looser matches.
- **Limits ranking per key.** Give each key its own threshold or maximum ranking.

```sh
npm install match-sorter
```

**vllm-project/recipes** (1.1K stars)

[vllm-project/recipes](https://github.com/vllm-project/recipes) 

```javascript
export function searchRecipes(recipes, query) {
  const q = query.trim();
  if (!q) return [];
  return q.split(/\s+/).reduceRight(
    (items, word) =>
      matchSorter(items, strip(word), {
        keys: RECIPE_KEYS,
        threshold: matchSorter.rankings.CONTAINS,
      }),
    recipes,
  );
}
```

[src/lib/search.js](https://github.com/vllm-project/recipes/blob/cec536c5d69d23d2810a7a26fb05e112d12e3a50/src/lib/search.js) · [More projects using match-sorter →](https://dashboard.exa.ai/playground/search?q=match-sorter%20GitHub%20projects)

**Quickstart**

```javascript
import { matchSorter } from 'match-sorter'

const results = matchSorter(['Mercury', 'Mars'], 'mr')

```

From [README.md](https://api.github.com/repos/kentcdodds/match-sorter/contents/README.md)

### fzf

[GitHub](https://github.com/ajitid/fzf-for-js) · [npm](https://www.npmjs.com/package/fzf) · [Docs](https://api.github.com/repos/ajitid/fzf-for-js/contents/README.md)

Finds ranked subsequence matches with configurable selection and tie-breaking.

- Downloads / mo: 18.3M
- Stars: 956
- Last release: 0.5.2
- License: BSD-3-Clause
- Capabilities: [From the fzf docs](https://api.github.com/repos/ajitid/fzf-for-js/contents/README.md)

**Strengths**

- **Controls ranking when scores tie.** Use tiebreakers to prefer shorter or earlier matches.
- **Returns matched character positions.** Read positions to highlight the characters that matched.

**Watch out for**

- **Async queries cancel earlier searches.** Handle cancellation rejections when issuing overlapping AsyncFzf queries.
- **Tie-breaking requires sorted output.** Keep sort enabled when configuring tiebreakers.

```sh
npm install fzf
```

**RooCodeInc/Roo-Code** (24.2K stars)

[RooCodeInc/Roo-Code](https://github.com/RooCodeInc/Roo-Code) 

```javascript
export async function searchWorkspaceFiles(
	query: string,
	workspacePath: string,
	limit: number = 20,
): Promise<{ path: string; type: "file" | "folder"; label?: string }[]> {
	try {
		// Get all files and directories (uses configured limit)
		const allItems = await executeRipgrepForFiles(workspacePath)

		// If no query, just return the top items
		if (!query.trim()) {
			return allItems.slice(0, limit)
		}

		// Create search items for all files AND directories
		const searchItems = allItems.map((item) => ({
			original: item,
			searchStr: `${item.path} ${item.label || ""}`,
		}))

		// Run fzf search on all items
		const fzf = new Fzf(searchItems, {
			selector: (item) => item.searchStr,
			tiebreakers: [byLengthAsc],
			limit: limit,
		})

		// Get all matching results from fzf
		const fzfResults = fzf.find(query).map((result) => result.item.original)

		// Verify types of the shortest results
		const verifiedResults = await Promise.all(
			fzfResults.map(async (result) => {
				const fullPath = path.join(workspacePath, result.path)
				// Verify if the path exists and is actually a directory
				if (fs.existsSync(fullPath)) {
					const isDirectory = fs.lstatSync(fullPath).isDirectory()
					return {
						...result,
						path: result.path.toPosix(),
						type: isDirectory ? ("folder" as const) : ("file" as const),
					}
				}
				// If path doesn't exist, keep original type
				return result
			}),
		)

		return verifiedResults
	} catch (error) {
		console.error("Error in searchWorkspaceFiles:", error)
		return []
	}
}

```

[src/services/search/file-search.ts](https://github.com/RooCodeInc/Roo-Code/blob/b867ec9145750d0ae1ff7f02d35406e9bf2a0b16/src/services/search/file-search.ts#L141-L194) · [More projects using fzf →](https://dashboard.exa.ai/playground/search?q=Projects%20using%20fzf%20for%20fuzzy%20matching%20command%20palettes%20file%20pickers%20or%20object%20lists&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
import { Fzf } from 'fzf'

const fzf = new Fzf(['Mercury', 'Mars'])
const results = fzf.find('mr')

```

From [main.d.ts](https://cdn.jsdelivr.net/npm/fzf@0.5.2/dist/types/main.d.ts)

### fast-fuzzy

[GitHub](https://github.com/EthanRutherford/fast-fuzzy) · [npm](https://www.npmjs.com/package/fast-fuzzy) · [Docs](https://api.github.com/repos/EthanRutherford/fast-fuzzy/contents/README.md)

Scores approximate text matches and reuses candidate lists through Searcher.

- Downloads / mo: 8.4M
- Stars: 388
- Last release: 1.12.0
- License: ISC
- Capabilities: [From the fast-fuzzy docs](https://api.github.com/repos/EthanRutherford/fast-fuzzy/contents/README.md)

**Strengths**

- **Reuses candidates across searches.** Create a Searcher to retain its candidate search structure.
- **Retains original-string match offsets.** Use returnMatchData to locate matches in the original text.

**Watch out for**

- **One-off search rebuilds candidates.** Use Searcher for repeated queries instead of calling search each time.
- **Offsets depend on substring mode.** Keep useSellers enabled when the result needs match offsets.

```sh
npm install fast-fuzzy
```

**bhj/KaraokeEternal** (930 stars)

[bhj/KaraokeEternal](https://github.com/bhj/KaraokeEternal) 

```javascript
(songs, artists) => new Searcher(songs.result as unknown as object[], {
    keySelector: ((songId: number) => {
      const song = songs.entities[songId]
      const artist = artists.entities[song.artistId]
      return fold(`${artist?.name ?? ''} ${song.title}`)
    }) as unknown as (s: object) => string,
    threshold: THRESHOLD,
  })
```

[src/routes/Library/selectors/getSearchResults.ts](https://github.com/bhj/KaraokeEternal/blob/5d46aca8cdea867d6a3c6933e63e480adba525b5/src/routes/Library/selectors/getSearchResults.ts) · [More projects using fast-fuzzy →](https://dashboard.exa.ai/playground/search?q=Projects%20using%20fast-fuzzy%20for%20fuzzy%20matching%20command%20palettes%20file%20pickers%20or%20object%20lists&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
const { search } = require('fast-fuzzy')

const results = search('mercury', ['Mercury', 'Mars'])

```

From [README.md](https://api.github.com/repos/EthanRutherford/fast-fuzzy/contents/README.md)

### microfuzz

[GitHub](https://github.com/Nozbe/microfuzz) · [npm](https://www.npmjs.com/package/@nozbe/microfuzz) · [Docs](https://api.github.com/repos/Nozbe/microfuzz/contents/README.md)

Filters items in memory and returns the matched character ranges for highlighting.

- Downloads / mo: 3.6M
- Last release: 1.0.0
- License: MIT
- Capabilities: [From the microfuzz docs](https://api.github.com/repos/Nozbe/microfuzz/contents/README.md)

**Strengths**

- **Matches words in any order.** A query's words can match in any order in the text.
- **Ignores case and accents.** A query matches text regardless of letter case and diacritics.

**Watch out for**

- **No typo tolerance.** Transposed or missing characters stop a match.

```sh
npm install @nozbe/microfuzz
```

**Quickstart**

```javascript
import createFuzzySearch from '@nozbe/microfuzz'

const search = createFuzzySearch(['Mercury', 'Mars'])
const results = search('mr')

```

From [index.d.ts](https://cdn.jsdelivr.net/npm/@nozbe/microfuzz@1.0.0/dist/index.d.ts) · [Find projects using microfuzz →](https://dashboard.exa.ai/playground/search?q=%40nozbe/microfuzz%20GitHub%20projects)

## FAQ

### Which JavaScript fuzzy search library should I use?

[Fuse.js](#fuse-js) fits searching objects with weighted fields. [fuzzysort](#fuzzysort) fits ranking short strings such as file names, and [match-sorter](#match-sorter) fits a filter box that needs a predictable ranking order.

### What is fuzzy search?

Fuzzy search finds items that match a query approximately rather than exactly. A fuzzy matcher still finds an item when the query skips letters or contains a typo.

### What is Fuse.js?

[Fuse.js](#fuse-js) is a fuzzy-search library with no dependencies that searches strings and object fields in the browser or on a server. Weighted keys let title matches rank above description matches.

### How is fuzzysort different from Fuse.js?

[fuzzysort](#fuzzysort) matches the query's characters in order and ranks short strings such as file names. [Fuse.js](#fuse-js) scores approximate matches across weighted object fields.

### Why can Fuse.js miss text far into a field?

Fuse.js scores a match lower the farther it starts from the expected location. Setting ignoreLocation to true removes that penalty.

## How this page was built

Data checked Nov 20, 2026.

Reproduce it with the Exa API:

```json
{
  "endpoint": "/search",
  "body": {
    "query": "Best JavaScript fuzzy search libraries Fuse.js fuzzysort fast-fuzzy fzf code examples",
    "numResults": 5
  }
}
```

Docs: https://exa.ai/docs/reference/search
