JavaScript plugin for finding links in plain-text and converting them to HTML <a> tags.
2,039
stars
107
commits
JavaScript
primary language
Sep 10, 2026
updated
Linkify is a JavaScript plugin. Use Linkify to find links in plain-text and convert them to HTML <a> tags. It automatically highlights URLs, #hashtags, @mentions and more.
[!NOTE] In November 2024, linkifyjs was transferred from its previous namespace Hypercontext to its primary maintainer @nfrasser, as Hypercontext winds down operations.
Jump to
Download the latest release for direct use in the browser, or install via NPM:
npm install linkifyjs linkify-html
When developing in an environment with JavaScript module loader such as Webpack,
use an import statement:
import * as linkify from 'linkifyjs';
import linkifyHtml from 'linkify-html';
Or in Node.js with CommonJS modules
const linkify = require('linkifyjs');
const linkifyHtml = require('linkify-html');
Note: When linkify-ing text that does not contain HTML, install and use the
linkify-string package instead of linkify-html. Read more about Linkify's
interfaces.
const options = { defaultProtocol: 'https' };
linkifyHtml('Any links to github.com here? If not, contact test@example.com', options);
Returns the following string:
'Any links to <a href="https://github.com">github.com</a> here? If not, contact <a href="mailto:test@example.com">test@example.com</a>';
To modify the resulting links with a target attribute, class name and more, use the available options.
linkify.find('Any links to github.com here? If not, contact test@example.com');
Returns the following array
[
{
type: 'url',
value: 'github.com',
isLink: true,
href: 'http://github.com',
start: 13,
end: 23,
},
{
type: 'email',
value: 'test@example.com',
isLink: true,
href: 'mailto:test@example.com',
start: 46,
end: 62,
},
];
Check if as string is a valid URL or email address:
linkify.test('github.com'); // true
Check if a string is a valid email address:
linkify.test('github.com', 'email'); // false
linkify.test('noreply@github.com', 'email'); // true
Read the interface documentation to learn how to use linkify when working with a specific JavaScript environment such as React.
By default Linkify will only detect and highlight web URLs and e-mail addresses. Plugins for @mentions, #hashtags and more may be installed separately. Read the plugin documentation.
Linkify natively supports all modern browsers. Older browsers supported with Babel.
Linkify is tested on Node.js 18 and up. Older Node.js versions are unofficially supported.
Download the latest release
View full documentation at linkify.js.org/docs
Check out CONTRIBUTING.md.
MIT
Linkify is made with ❤️ by @nfrasser
(top 30 of 34)
JavaScript
71.9%
HTML
28.1%
JavaScript plugin for finding links in plain-text and converting them to HTML <a> tags.
2,039
stars
107
commits
JavaScript
primary language
Sep 10, 2026
updated
Linkify is a JavaScript plugin. Use Linkify to find links in plain-text and convert them to HTML <a> tags. It automatically highlights URLs, #hashtags, @mentions and more.
[!NOTE] In November 2024, linkifyjs was transferred from its previous namespace Hypercontext to its primary maintainer @nfrasser, as Hypercontext winds down operations.
Jump to
Download the latest release for direct use in the browser, or install via NPM:
npm install linkifyjs linkify-html
When developing in an environment with JavaScript module loader such as Webpack,
use an import statement:
import * as linkify from 'linkifyjs';
import linkifyHtml from 'linkify-html';
Or in Node.js with CommonJS modules
const linkify = require('linkifyjs');
const linkifyHtml = require('linkify-html');
Note: When linkify-ing text that does not contain HTML, install and use the
linkify-string package instead of linkify-html. Read more about Linkify's
interfaces.
const options = { defaultProtocol: 'https' };
linkifyHtml('Any links to github.com here? If not, contact test@example.com', options);
Returns the following string:
'Any links to <a href="https://github.com">github.com</a> here? If not, contact <a href="mailto:test@example.com">test@example.com</a>';
To modify the resulting links with a target attribute, class name and more, use the available options.
linkify.find('Any links to github.com here? If not, contact test@example.com');
Returns the following array
[
{
type: 'url',
value: 'github.com',
isLink: true,
href: 'http://github.com',
start: 13,
end: 23,
},
{
type: 'email',
value: 'test@example.com',
isLink: true,
href: 'mailto:test@example.com',
start: 46,
end: 62,
},
];
Check if as string is a valid URL or email address:
linkify.test('github.com'); // true
Check if a string is a valid email address:
linkify.test('github.com', 'email'); // false
linkify.test('noreply@github.com', 'email'); // true
Read the interface documentation to learn how to use linkify when working with a specific JavaScript environment such as React.
By default Linkify will only detect and highlight web URLs and e-mail addresses. Plugins for @mentions, #hashtags and more may be installed separately. Read the plugin documentation.
Linkify natively supports all modern browsers. Older browsers supported with Babel.
Linkify is tested on Node.js 18 and up. Older Node.js versions are unofficially supported.
Download the latest release
View full documentation at linkify.js.org/docs
Check out CONTRIBUTING.md.
MIT
Linkify is made with ❤️ by @nfrasser
(top 30 of 34)
JavaScript
71.9%
HTML
28.1%