A lightweight browser extension that provides real-time grammar and spell checking using the LanguageTool API. Connect to any LanguageTool API endpoint - whether self-hosted or official - for instant writing feedback across all text fields on the web.
- Real-time Grammar & Spell Checking: Instant feedback as you type in any text field
- Visual Underlines: Errors are highlighted with color-coded underlines
- Smart Suggestions: Click on any underlined error to see replacement suggestions
- Auto-Check Mode: Automatically checks text as you type (configurable)
- Flexible Endpoints: Connect to self-hosted or official LanguageTool servers
- Multi-Language Support: Works with any language supported by LanguageTool
- Context Menu Integration: Right-click in any text field to manually trigger a check
- Status Badge: Visual indicator showing check status and error count
- Performance Optimized: Intelligent debouncing and caching to minimize API calls
- Clone or download this repository
- Open your browser's extension management page:
- Chrome/Edge: Navigate to
chrome://extensions/
- Chrome/Edge: Navigate to
- Enable "Developer mode"
- Click "Load unpacked" and select the extension directory
After installation, click the extension icon or right-click in any text field and select "Options" to configure:
- Endpoint: The URL of your LanguageTool API server (default:
http://localhost:8081) - Language: The language code for checking (e.g.,
en-US,de,fr) - Auto-Check: Enable/disable automatic checking as you type
- Debounce: Delay in milliseconds before sending a check request (recommended: 600-1200ms)
Running your own LanguageTool server gives you complete control over your data and removes dependency on external services.
The easiest way to self-host LanguageTool is using Docker:
docker run -d \
--name languagetool \
-p 8081:8010 \
-e langtool_languageModel=/ngrams \
-e Java_Xms=512m \
-e Java_Xmx=1g \
erikvl87/languagetoolThis will start LanguageTool on http://localhost:8081.
With n-gram datasets for better quality:
docker run -d \
--name languagetool \
-p 8081:8010 \
-e langtool_languageModel=/ngrams \
-e Java_Xms=2g \
-e Java_Xmx=4g \
-v /path/to/ngrams:/ngrams \
erikvl87/languagetoolDownload n-gram datasets from LanguageTool's website.
Create a docker-compose.yml file:
version: '3'
services:
languagetool:
image: erikvl87/languagetool
container_name: languagetool
ports:
- "8081:8010"
environment:
- langtool_languageModel=/ngrams
- Java_Xms=512m
- Java_Xmx=1g
restart: unless-stoppedStart with:
docker-compose up -d-
Install Java: LanguageTool requires Java 8 or later
# Ubuntu/Debian sudo apt install openjdk-11-jre-headless # macOS brew install openjdk@11
-
Download LanguageTool: Get the standalone version from languagetool.org
wget https://languagetool.org/download/LanguageTool-stable.zip unzip LanguageTool-stable.zip cd LanguageTool-*
-
Start the Server:
java -cp languagetool-server.jar org.languagetool.server.HTTPServer \ --port 8081 \ --allow-origin "*" -
Test the Server:
curl -d "text=This is a test" -d "language=en-US" http://localhost:8081/v2/check
If you prefer not to self-host, you can use the official LanguageTool service:
- Sign up at languagetool.org
- Set the endpoint to:
https://api.languagetoolplus.com - Note: The free tier has rate limits; consider LanguageTool Premium for unlimited checks
- Memory: Allocate at least 512MB RAM (1-2GB recommended for better performance)
- Port: The default port is 8010 in Docker, but you can map it to any port
- CORS: Use
--allow-origin "*"to allow browser requests (already configured in Docker image) - Performance: Enable n-gram datasets for improved detection quality
- Multiple Languages: LanguageTool supports 30+ languages out of the box
If running LanguageTool on a different machine:
- Make sure the port is accessible from your browser's machine
- Update the extension's endpoint setting to point to your server's IP/hostname
- Example:
http://192.168.1.100:8081orhttps://languagetool.yourdomain.com
- Local Network Only: If possible, keep LanguageTool on your local network
- HTTPS: For production deployments, use HTTPS with a reverse proxy (nginx, Caddy)
- Authentication: Consider adding authentication if exposing to the internet
- Firewall: Restrict access to trusted IPs if deploying on a server
Once configured, the extension works automatically:
- Auto-Check Mode: Type in any text field, and errors will appear with underlines after a short delay
- Manual Check: Right-click in a text field and select "Mit LanguageTool prüfen" (Check with LanguageTool)
- View Suggestions: Click on any underlined error to see replacement suggestions
- Apply Fix: Click a suggestion to apply it instantly
- Status Badge: Look at the bottom-right corner of each text field to see:
- Spinner: Check in progress
- Green checkmark: No errors found
- Number: Count of detected errors
The extension works with:
- Standard HTML
<textarea>elements - Text
<input>fields (text, search, email, url, tel) - ContentEditable elements (rich text editors)
- Chrome/Edge: Full support (Manifest V3)
- Brave, Opera, Vivaldi: Should work as Chromium-based browsers
This extension:
- Only sends text content to the configured LanguageTool endpoint
- Does not collect or transmit any personal data
- Does not use external analytics or tracking
- Stores settings locally using browser storage sync
When self-hosting, your text never leaves your network.
languagetool-extension/
├── manifest.json # Extension configuration
├── background.js # Service worker (context menu)
├── content.js # Main content script (checking logic)
├── options.html # Settings page
├── options.js # Settings page logic
├── options.css # Settings page styles
├── overlay.css # Underline and popover styles
└── icons/ # Extension icons
- content.js: Handles text monitoring, API calls, and UI rendering
- background.js: Manages context menu integration
- options.js: Settings management with chrome.storage.sync
The extension uses the LanguageTool HTTP API v2:
POST /v2/check
Content-Type: application/x-www-form-urlencoded
text=Your text here&language=en-USResponse contains matches with offset, length, message, and replacement suggestions.
- Verify the LanguageTool server is running and accessible
- Check the endpoint URL in extension options (must include
http://orhttps://) - Test the API manually:
curl -d "text=test" -d "language=en-US" http://localhost:8081/v2/check - Check browser console for error messages
If using a self-hosted server, ensure it's started with --allow-origin "*" or configure proper CORS headers.
- Verify auto-check is enabled in options
- Type more than 8 characters (minimum threshold)
- Check if the text field type is supported
- Look for the status badge - spinner means checking, number means errors found
- Increase the debounce time in settings (try 1000-1500ms)
- Ensure your LanguageTool server has adequate resources
- Consider enabling caching on the server side
Contributions are welcome! Please feel free to submit issues or pull requests.
This extension is open source. LanguageTool itself is licensed under LGPL 2.1 or later.
- Built for use with LanguageTool
- Docker image by erikvl87
- LanguageTool Website: https://languagetool.org/
- LanguageTool GitHub: https://github.com/languagetool-org/languagetool
- LanguageTool API Docs: https://languagetool.org/http-api/swagger-ui/#!/default/post_check
- Docker Image: https://hub.docker.com/r/erikvl87/languagetool