Free tool

jQuery to JavaScript converter

Paste jQuery, get plain JavaScript. The output is a small, chainable utility that stands in for jQuery, so your existing code keeps working without a rewrite.

View on GitHub 100% test coverage

jQuery

JavaScript

Why

Most of jQuery is already in the browser

Many projects use a small fraction of jQuery, and modern browsers cover that fraction natively. Dropping the library is usually worth it; rewriting every call site is not. The converter does the rewrite for you.

  1. 01

    Your code stays as it is

    The tool reads the jQuery methods your code calls and generates a utility that implements only those. Your calls do not change; jQuery itself does.

  2. 02

    Chainable, modern, tested

    The generated methods chain like jQuery’s and are written in modern JavaScript with full test coverage, so the utility is small enough to read.

  3. 03

    Runs where you are

    Conversion happens in your browser; nothing is uploaded. The same engine ships as a CLI for whole projects and continuous integration.

FAQ

Questions people ask first

What does the converter do?

It turns the jQuery your code uses into plain JavaScript: a small utility that replaces the jQuery library while your original code stays unchanged.

Do I need to modify my existing jQuery code?

No. The generated JavaScript is a drop-in for jQuery, so the code you already have runs as before, without the jQuery library.

Which browsers does the generated code support?

All modern browsers, and Internet Explorer 11 and newer, so the output works across the environments your users have.

Are all jQuery methods supported?

Most of them. For a few, such as Ajax, a small dedicated library is the better replacement; the converter tells you which methods it skipped. The full list of supported methods is in the repository.

How does the conversion work?

Your source is parsed into an abstract syntax tree. The tool walks the tree, finds the jQuery methods in use and emits the matching vanilla implementations from its tested library, then formats the result.

Can I use it on a large project?

Yes. For many files, use the CLI below: it batch-processes files that match a pattern and writes one utility for the whole project.

Is there a VS Code extension?

Not yet. The project is open source and contributions are welcome if you would like to build one.

CLI

Whole projects, from the terminal

The same converter as a command line tool, for many files at once and for build pipelines.

Install it from npm:

npm install -g replace-jquery

Convert one file, writing the vanilla JavaScript to another:

replace-jquery src/sample.js out.js

Convert every file that matches a pattern:

replace-jquery "src/*.js" out.js

Generate vanilla alternatives for every jQuery method the tool knows:

replace-jquery --build-all out.js

Or only for the methods you name:

replace-jquery --methods "addClass, removeClass, attr" -o utils.js

The generated utilities are not equivalent to jQuery in every edge case. Treat the output as a starting point and test it before you adopt it.