hilite2ai.js is a lightweight JavaScript tool that transforms any website into an AI-enhanced learning platform. With just one line of code, your visitors can highlight any text and instantly copy a contextual prompt directly to their favorite AI assistant or, if they use Claude or ChatGPT, immediately obtain a response.
This allows you to leverage the content already on your website by enhancing it without the need to add hyperlinks or in-depth clarifications, and without running up an expensive AI API bill. Visitors to your web page need only highlight any text that they would like further information about, and hilite2ai.js will compile all the background information needed to ensure the user's AI gives the most relevant reponse.
Best of all, users only temporarily leave your page to get further information (generally by keeping a chatbot open in another tab) and are not sent away, allowing you to increase user engagement and retention.
Add one line and you're done. No configuration is needed other than an optional second line to inform users how hilite2ai.js works.
As well as the highlight, hilite2ai.js includes the page title, page URL, and the nearest preceding heading for better AI responses.
No data is sent to external servers. Everything stays on the user's device and is between them and their chosen chatbot.
Works with Claude, ChatGPT, Copilot, Gemini, Grok, Qwen, Deepseek, or any local or online AI tool your users prefer.
The responsive design of hilite2ai.js works perfectly on all devices that support the highlighting of text in a browser.
You can override the provided CSS classes if you wish to tailor hilite2ai.js to match your site's design.
👉 Highlight any text below and click the "🤖 Copy to AI" button that appears to create a pastable prompt. Or click the "Claude" or "ChatGPT" button for an imediate response!
Machine learning is a subset of artificial intelligence that enables computers to learn and improve from experience without being explicitly programmed. Instead of following rigid instructions, machine learning algorithms use statistical techniques to identify patterns in data and make decisions with minimal human intervention.
Neural networks are computing systems inspired by the biological neural networks in animal brains. They consist of interconnected nodes (neurons) organized in layers. Each connection can transmit a signal from one neuron to another, and the receiving neuron processes the signal and signals downstream neurons connected to it. The backpropagation algorithm is fundamental to training neural networks, allowing them to adjust their internal parameters.
Deep learning, a more advanced form of machine learning, powers many modern AI applications including image recognition, natural language processing, autonomous vehicles, and recommendation systems. The "deep" in deep learning refers to the multiple layers of neural networks that process information in increasingly abstract ways.
Adding hilite2ai.js to your website is incredibly simple:
<script src="https://cdn.jsdelivr.net/gh/RobinNixon/hilite2ai.com@main/hilite2ai.min.js"></script>
<div id="hilite2ai"></div>
This creates a dismissible banner letting users know your site is AI-enhanced.
For more details, customization options, and advanced usage, visit the GitHub repository.
When a user highlights text on your page and clicks the button, hilite2ai.js creates a structured prompt with context, ready to paste directly into a chatbot, that looks like this:
Message created via hilite2ai.com
I am viewing:
• Source: https://allaboutml.com/introduction.html
• Title: Understanding Machine Learning
• Section: Neural Networks
Please explain: "backpropagation algorithm"
This contextual information helps AI assistants provide more accurate, relevant answers tailored to what the user is reading.