We've all been there: you're writing a Markdown document, styling a UI component, or drafting an email, and you need a specific symbol. Maybe it's a right-facing arrow (→), a checkmark (✓), or an obscure mathematical operator.
Usually, the workflow looks like this:
- Open a new browser tab.
- Search "right arrow symbol copy paste".
- Click a website covered in ads.
- Highlight, copy, go back to your editor, and paste.
It is a minor interruption, but doing it ten times a day ruins your flow. That is the exact problem that led me to build SymbolHub, a clean, fast, and utility-first tool to search and copy any special character instantly. You can try the live version here: https://symbolhub.getinfotoyou.com.
Here is how I built it, the technical choices I made, and the challenges of handling thousands of Unicode characters directly in the browser.
The Goal: Zero Latency and High Precision
When you need a symbol, you want it immediately. I wanted the search experience to feel as fast as typing in a terminal. That meant no database queries, no loading spinners, and no heavy client-side frameworks.
The application needed to:
- Load in under 200ms.
- Support fuzzy search (e.g., typing "arrow" should show all arrows, but typing "right" should filter it down).
- Group symbols logically (e.g., Math, Punctuation, Currency, Emojis).
- Copy to clipboard with a single click.
The Technical Stack
I chose to keep the stack incredibly lean:
- Frontend: HTML5 and Vanilla CSS (using modern CSS variables and grid systems).
- Logic: Vanilla JavaScript.
- Data: A pre-processed JSON file containing approximately 1,500 of the most commonly used Unicode characters, classified by names, categories, and tags.
Using vanilla JavaScript instead of React or Vue eliminated build-step overhead and kept the initial bundle size tiny. The entire site, including the symbol database, weighs under 100KB gzipped.
Technical Challenges
1. Fast Fuzzy Searching in the Browser
Since the database lives entirely on the client side, searching through 1,500+ items is fast but can still cause UI stuttering if not done carefully. If a user types quickly, triggering a DOM redraw on every keystroke blocks the main thread.
To solve this, I implemented a simple debounce function for the input handler and used a lightweight indexing strategy. Instead of searching the entire JSON structure, each symbol object has a pre-compiled search string:
symbol.searchString = `${symbol.name} ${symbol.category} ${symbol.tags.join(' ')}`.toLowerCase();
When a user types, we filter the array using a basic indexOf check on this string. If the result set changes, we update the DOM.
2. DOM Batching and Performance
Redrawing 1,000 grid elements is expensive. To keep the UI responsive, SymbolHub uses a virtualized rendering approach. If a query returns hundreds of results, we only render the first 150 immediately. A simple IntersectionObserver loads more as the user scrolls. This keeps the initial search response time under 10ms.
3. The Clipboard API vs. Browser Support
Copying text to the clipboard seems simple with navigator.clipboard.writeText(). However, older mobile browsers and certain webviews do not fully support this API, or they require strict user-interaction contexts.
I wrote a fallback utility that falls back to the older document.execCommand('copy') if the modern API fails:
async function copyToClipboard(text) {
try {
await navigator.clipboard.writeText(text);
return true;
} catch (err) {
const textArea = document.createElement("textarea");
textArea.value = text;
document.body.appendChild(textArea);
textArea.select();
try {
document.execCommand('copy');
return true;
} catch (fallbackErr) {
return false;
} finally {
document.body.removeChild(textArea);
}
}
}
Lessons Learned
- Vanilla JS is still incredibly capable: For utility apps, you rarely need a heavy SPA framework. The browser's native APIs are fast, mature, and easy to work with.
-
Accessibility matters for symbols: Screen readers interpret Unicode differently. I added
aria-labelattributes to each symbol card to describe what the symbol is, rather than letting the screen reader try to pronounce the raw Unicode character. - Keep the UX out of the way: The best utility tools are the ones that require the fewest clicks.
Check It Out
If you find yourself searching for special characters, bookmark SymbolHub. It is completely free, runs entirely in your browser, and has no tracking or ads.
Let me know what categories or features you would like to see added next!
Top comments (0)