Finds URLs, emails, hashtags, and mentions in strings and can emit HTML anchor tags. Works in browsers and Node.js with React or jQuery helpers.
Overview
Linkify is a JavaScript library that scans plain text for links and related patterns and converts them to HTML a tags. By default it handles web URLs and email addresses; optional plugins add hashtags, at-mentions, and ticket-style tags.
The core package supports finding links, testing whether a string is a valid link, and producing linkified HTML with configurable attributes. Separate packages cover HTML string output, plain string output, and framework-specific bindings for React and jQuery. Documentation at linkify.js.org describes interfaces and plugins.
Install from npm (linkifyjs) or use a browser zip build. For text without embedded HTML, linkify-string is recommended over linkify-html. The project targets modern browsers and Node.js 18+ in testing, with older environments possible via transpilation.
Custom link plugins extend detection beyond built-in types. Multi-language and emoji domain examples appear in project demos and docs.
Key features
- URL and email autolinking
- Optional hashtag and mention plugins
- React and jQuery integrations
- linkify-html and linkify-string packages
- Custom link plugin API
- Emoji and IDN domain support
- Valid-link test helpers
Use cases
- Autolinking chat or comment text
- Rendering user markdown-free messages
- Social @mention and #hashtag highlighting
- Node and bundler plain-text pipelines