Open Source

quickfuzz

Blazing-fast, zero-dependency fuzzy search for JavaScript & TypeScript. Optimized for small datasets. Built for speed.

$ npm install quickfuzz
View on npm GitHub
0
ms avg (1K items)
0
dependencies
0
bundle size
0
TypeScript
Performance

Faster than the competition

benchmarked on 1,000 items — up to ~7x faster than traditional fuzzy search libraries

quickfuzz
0.12ms 7x faster
Others
~1.5ms
Features

Everything you need, nothing you don't

Built to be fast, small, and easy to use.

Blazing Fast

Optimized sequential matching algorithm delivers results in under 0.2ms for 1,000 items. No heavy indexing step.

📦

Zero Dependencies

Nothing to audit, nothing to break. The entire library is self-contained with no external packages.

🛠

Full TypeScript

Generics, key inference, and IntelliSense out of the box. Your IDE knows your data shape.

🎯

Configurable Threshold

Human-readable threshold from 1 (loose) to 10 (strict). No confusing 0.0–1.0 floats.

🔍

Multi-Key Search

Search across multiple object fields at once. Perfect for user directories, product catalogs, and more.

Match Highlighting

Get exact matched character indices with .search(). Build highlighted results in your UI.

Try it

Live demo

Type anything below — this is the actual algorithm running in your browser right now.

Start typing to search...
Examples

Simple by design

One import. One function. You're done.

import { createFuzzySearch } from "quickfuzz";

const fruits = ["apple", "pineapple", "grape", "banana"];

const search = createFuzzySearch(fruits, { threshold: 5 });

search("aple");   // ["apple"]
search("ban");    // ["banana"]
import { createFuzzySearch } from "quickfuzz";

const users = [
  { name: "Alice Johnson", email: "alice@example.com" },
  { name: "Bob Smith", email: "bob@example.com" },
];

// Search across multiple keys
const search = createFuzzySearch(users, {
  key: ["name", "email"],
  threshold: 4,
  maxResults: 5,
});

search("bob");
// [{ name: "Bob Smith", email: "bob@example.com" }]
import { createFuzzySearch } from "quickfuzz";

const search = createFuzzySearch(
  ["apple", "pineapple"],
  { threshold: 5 }
);

// Use .search() for full details
search.search("aple");
// [
//   { item: "apple",     score: 0.71, matches: [0,1,3,4] },
//   { item: "pineapple", score: 0.59, matches: [4,5,7,8] }
// ]
function highlight(text: string, indices: number[]) {
  return text
    .split("")
    .map((c, i) =>
      indices.includes(i) ? `<b>${c}</b>` : c
    )
    .join("");
}

highlight("apple", [0,1,3,4]);
// "<b>a</b><b>p</b>p<b>l</b><b>e</b>"
API

Configuration

createFuzzySearch(data, options?)

Option Type Default Description
key keyof T | (keyof T)[] Object key(s) to search
threshold 1–10 5 Match strictness (1 = loose, 10 = strict)
caseSensitive boolean false Enable case-sensitive matching
maxResults number unlimited Cap the number of returned results
Benchmarks

Numbers don't lie

Averaged over 100 runs. Tested on real datasets.

0
ms
1,000 strings
0
ms
5,000 strings
0
ms
10,000 strings
0
ms
5,000 objects (2 keys)