Blazing-fast, zero-dependency fuzzy search for JavaScript & TypeScript. Optimized for small datasets. Built for speed.
npm install quickfuzz
benchmarked on 1,000 items — up to ~7x faster than traditional fuzzy search libraries
Built to be fast, small, and easy to use.
Optimized sequential matching algorithm delivers results in under 0.2ms for 1,000 items. No heavy indexing step.
Nothing to audit, nothing to break. The entire library is self-contained with no external packages.
Generics, key inference, and IntelliSense out of the box. Your IDE knows your data shape.
Human-readable threshold from 1 (loose) to 10 (strict). No confusing 0.0–1.0 floats.
Search across multiple object fields at once. Perfect for user directories, product catalogs, and more.
Get exact matched character indices with .search(). Build highlighted results in your UI.
Type anything below — this is the actual algorithm running in your browser right now.
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>"
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 |
Averaged over 100 runs. Tested on real datasets.