Nearly Perpendicular Macaroons
    Have ideas to improve npm?Join in the discussion! »

    DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/linkifyjs package

    3.0.0-beta.3 • Public • Published


    npm version Build Status Sauce Test Status Coverage Status

    Build Status

    Linkify is a small yet comprehensive JavaScript plugin for finding URLs in plain-text and converting them to HTML links. It works with all valid URLs and email addresses.

    A build repository is maintained here.

    Jump to


    • Accuracy
      Linkify uses a (close to) complete list of valid top-level domains to ensure that only valid URLs and email addresses are matched.
    • Speed
      Each string is analyzed exactly once to detect every kind of linkable entity
    • Internationalization
      Linkify detects Internationalized Domains, hashtags and more in any language
    • Extensibility
      Linkify is designed to be fast and lightweight, but comes with a powerful plugin API that lets you detect even more information like #hashtags and @mentions.
    • Small footprint
      Linkify and its string element interface clock in at approximately 30KB minified (15KB gzipped)
    • Modern implementation
      Linkify is written in ECMAScript 2015+ and compiles to ES5 for modern JavaScript runtimes.
      • Linkify is compatible with all modern browsers, as well as Internet Explorer 11 and up.


    Launch demo

    Installation and Usage

    View full documentation.

    Download the latest release, or install via NPM

    npm install --save linkifyjs

    or Yarn

    yarn add linkifyjs

    Quick Start

    Add linkify and linkify-element to your HTML following jQuery:

    <script src=""></script>
    <script src="linkify.min.js"></script>
    <script src="linkify-element.min.js"></script>

    Note: A polyfill is required for Internet Explorer 11.

    Find all links and convert them to anchor tags

    // Linkify single element
    // Linkify all paragraphs
    for (const element of document.querySelectorAll('p')) {

    Find all links in the given string

    linkify.find('Any links to here? If not, contact');

    Returns the following array

        type: 'url',
        value: '',
        href: ''
        type: 'email',
        value: '',
        href: ''

    See all available options

    ES Modules

    import * as linkify from 'linkifyjs';
    import 'linkifyjs/plugins/hashtag'; // optional
    import linkifyHtml from 'linkifyjs/html';

    Node.js / CommonJS modules

    const linkify = require('linkifyjs');
    require('linkifyjs/plugins/hashtag'); // optional
    const linkifyHtml = require('linkifyjs/html');

    Example string usage

    linkifyHtml('The site is #awesome.', {
      defaultProtocol: 'https'

    Returns the following string

    'The site <a href=""></a> is <a href="#awesome">#awesome</a>.'

    Note that if you are using linkify-jquery.amd.js, a jquery module must be defined.

    Browser globals

    <script src="react.js"></script>
    <script src="react-dom.js"></script>
    <script src="linkify.js"></script>
    <script src="linkify-react.js"></script>
    linkify.test(''); // true
      <Linkify options={{ignoreTags: ['style']}}>
        Check out it is great!

    Browser Support

    Linkify works on all modern browsers. Linkify supports Internet Explorer 11 with a polyfill.

    Use one of the following polyfills

    • provided linkifyjs/polyfill submodule (dist/linkify-polyfill.js) - see example below
    • core-js (only the following two submodules are required:)
      • core-js/modules/es.array.from.js
      • core-js/modules/es.string.iterator.js
    • es5-shim (sham also required)
    <script src="jquery.js"></script>
    <!--[if IE 11]>
    <script src="linkify-polyfill.js"></script>
    <script src="linkify.js"></script>
    <script src="linkify-jquery.js"></script>

    Node.js Support

    Linkify is tested on Node.js 8 and up. Older versions are unofficially supported.


    Download the latest release

    linkify (required)
    .min.js · .js · .amd.min.js · .amd.js

    Plugins (optional)

    Interfaces (recommended - include at least one)

    API Documentation

    View full documentation at


    The core linkify library (excluding plugins) attempts to find emails and URLs that match RFC specifications. However, it doesn't always get it right.

    Here are a few of the known issues.

    • Non-standard email local parts delimited by " (quote characters)
      • Emails with quotes in the localpart are detected correctly, unless the quotes contain certain characters like @.
    • Slash characters in email addresses


    Check out




    Linkify is built with Love™ and maintained by SoapBox Innovations.


    npm i linkifyjs

    DownloadsWeekly Downloads






    Unpacked Size

    444 kB

    Total Files


    Last publish


    • avatar