translate.js is an open-source JavaScript library that adds automatic translation to any web page with just two lines of code. Drop in the script, call one function, and your existing HTML is translated into your visitor’s language on the fly — no separate language versions of your pages, no translation files to maintain and no API key to configure. The project has about 3,100 stars on GitHub and continues to be updated in 2026.
The library works entirely on the client side: it detects the user’s language, walks the DOM and replaces text nodes with translations served by its translation channels, while watching for dynamically loaded content so single-page apps and AJAX updates are handled too. Site owners keep control through ignore lists — specific tags, classes or elements can be excluded — and the current language can be forced or switched through a built-in selector UI. Because translation happens in the browser without restructuring URLs, it stays SEO-friendly compared with machine-generated duplicate pages, and it supports well over a hundred languages. For small sites, blogs, documentation and product pages that cannot justify a full i18n engineering effort, translate.js offers a pragmatic shortcut: paste two lines, and the site becomes readable worldwide.
translate.js is completely free and open source under the MIT license, and its default translation channels work without signing up for a paid translation API.
translate.js is for website owners, bloggers and small product teams who want instant multilingual reach for an existing site without the cost and maintenance of a full internationalization project.