An intelligent, AI-powered grammar correction tool for Windows that fixes your text with a simple hotkey. Powered by Google's Gemini 2.5 Flash Lite API.
.EXE (ready application can be found in the "releases" in the GitHub here) - https://github.com/TheHolyOneZ/GrammarFixer/releases/tag/GrammarFixer_1.0.0
Images of the application can be found in the "images/" folder
- 🎯 Global Hotkey System: Fix grammar anywhere with a customizable keyboard shortcut (default: Ctrl+Alt+T)
- 🤖 AI-Powered Corrections: Uses Google Gemini 2.5 Flash Lite for intelligent, context-aware grammar correction
- ⚡ Multi-Speed Processing: Choose between Fast, Normal, or Detailed correction modes based on your needs
- 🎭 Writing Personas: Transform your writing style with 5 distinct personas
- 🔄 Flexible Output Modes: 5 different ways to handle corrected text
Each persona applies different writing styles while fixing grammar:
-
Standard - Pure grammar correction
- Fixes errors without changing tone or style
- Maintains your original voice
- Perfect for technical writing or when you want minimal changes
-
Friendly - Conversational and warm
- Makes text more approachable
- Adds warmth to professional communications
- Great for emails to colleagues or casual writing
-
Professional - Formal and polished
- Transforms text into business-appropriate language
- Removes casual expressions
- Ideal for reports, proposals, and formal communications
-
Concise - Brief and direct
- Removes unnecessary words and fluff
- Gets straight to the point
- Perfect for executive summaries or space-limited content
-
Creative - Expressive and dynamic
- Adds vivid language and engaging style
- Makes content more captivating
- Great for marketing copy or creative writing
-
Fast: Minimal corrections with quick turnaround
- Temperature: 0.1 (more deterministic)
- Max tokens: 512
- Best for: Quick fixes, minor corrections
-
Normal (Recommended): Thorough grammar fixing
- Temperature: 0.3 (balanced)
- Max tokens: 1024
- Best for: General use, daily corrections
-
Detailed: Comprehensive fixes with improved clarity
- Temperature: 0.5 (more creative)
- Max tokens: 2048
- Best for: Important documents, final drafts
- Replace Text: Automatically replaces selected text with corrected version
- Copy to Clipboard: Saves corrected text without replacing original
- Append to End: Adds corrected text after your selection
- Prepend to Start: Adds corrected text before your selection
- Show in Popup: Displays corrected text in a popup window
- 🔐 Encrypted API Keys: AES-256 encryption with Windows DPAPI
- 📊 Token Usage Tracking: Monitor API usage and estimated costs
- 🎨 Modern Dark UI: Sleek interface with smooth animations
- 💾 System Tray Integration: Run in background, minimize to tray
- 🚀 Auto-Start: Optional Windows startup integration
- 🔔 Notifications: Visual and audio feedback options
- 📈 Usage Statistics: Track fixes over time
- 🎯 Input Source Options: Auto-copy selection or use existing clipboard
- OS: Windows 10 (1809+) or Windows 11
- Runtime: .NET 8.0 Runtime (Download)
- API Key: Google Gemini API Key (Get one free)
- RAM: 100MB minimum
- Disk: 50MB installation space
- Go to the Releases page
- Download the latest
GrammarFixer.exe - Run
GrammarFixer.exe - Enter your Gemini API key in settings
- Start fixing grammar with your hotkey!
# Clone the repository
git clone https://github.com/TheHolyOneZ/GrammarFixer.git
cd GrammarFixer
# Option A: Using build script (Windows)
build.bat
# Option B: Manual build
dotnet restore
dotnet publish GrammarFixer\GrammarFixer.csproj -c Release -r win-x64 --self-contained true -o publish
# Run the application
cd publish
GrammarFixer.exe-
Get an API Key
- Visit Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy the key
-
Configure Grammar Fixer
- Paste your API key in the "API Configuration" section
- The key is automatically encrypted and saved
- Choose your preferred settings (persona, speed, mode)
-
Start Using
- Highlight any text in any application
- Press your hotkey (default:
Ctrl+Alt+T) - Watch your text get corrected automatically!
Selected Text (Auto-Copy)
- Automatically copies highlighted text when you press the hotkey
- No need to manually copy text first
- Works in any application that supports text selection
- Recommended for most users
Clipboard Content Only
- Uses existing clipboard content
- You must manually copy text first (Ctrl+C)
- Useful if auto-copy doesn't work in certain applications
- Good for troubleshooting
- Click "🔄 Change" next to Current Hotkey
- Press your desired key combination
- Must include at least one modifier (Ctrl/Alt/Shift)
- Click "✓ Save" to confirm
- Test the new hotkey
Popular Hotkey Combinations:
Ctrl + Alt + T(default)Ctrl + Shift + GAlt + Shift + FCtrl + Alt + F
Start with Windows
- Launches Grammar Fixer when you log in
- Stays running in system tray
- Always ready to fix grammar
Start Minimized
- Only works when "Start with Windows" is enabled
- Starts in system tray without showing window
- Completely silent startup
Minimize to Tray
- Hides window when minimized
- Shows notification when minimized
- Access from system tray icon
- Double-click icon to restore
- Input Tokens: Characters in your original text
- Output Tokens: Characters in corrected text
- Total Tokens: Sum of input + output
Default pricing: $0.10 per 1 million tokens
You can customize this in the Token Usage window to match your actual API pricing.
-
Click "📊 View Token Usage and Costs"
-
See breakdown by:
- Today
- This Week (last 7 days)
- This Month (last 30 days)
- All Time
-
View recent usage history with timestamps
-
Customize price per million tokens
-
Estimated costs are calculated in real-time
Based on default pricing ($0.10 per million tokens):
- 100 corrections of 100 words each ≈ $0.002
- 1,000 corrections ≈ $0.02
- 10,000 corrections ≈ $0.20
Note: Actual costs vary based on text length and correction complexity
Grammar Fixer stores data in standard Windows locations:
Application Settings
%APPDATA%\GrammarFixer\settings.json
Contains: API key (encrypted), preferences, statistics
Encryption Key
%LOCALAPPDATA%\GrammarFixer\.key
Contains: AES-256 encryption key (hidden file)
Log Files
%LOCALAPPDATA%\GrammarFixer\Logs\GrammarFixer_YYYY-MM-DD.txt
Contains: Error logs, startup/shutdown events
When "Start with Windows" is enabled:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Key: GrammarFixer
Value: "C:\Path\To\GrammarFixer.exe" --minimized
# Start minimized in system tray
GrammarFixer.exe --minimizedWhat's Stored Locally:
- Encrypted API key
- User preferences
- Token usage statistics
- Error logs
What's Sent to Google:
- Only the text you're correcting
- Sent via HTTPS to Google's Gemini API
- Not stored by Grammar Fixer
What's NOT Collected:
- No analytics or telemetry
- No personal information
- No browsing history
- No file access
- Encryption: AES-256 with unique machine key
- Key Storage: Hidden file in LocalAppData
- Transmission: Only sent to Google's API via HTTPS
- Access: Only Grammar Fixer can decrypt your key
- Review Google's Privacy Policy
- Don't send sensitive/confidential information
- Be aware text is processed on Google's servers
- Keep your API key secure (don't share)
Check Log File:
%LOCALAPPDATA%\GrammarFixer\Logs\
Open the most recent log file for error details.
Common Solutions:
- Install .NET 8.0 Runtime
- Run as Administrator
- Check antivirus isn't blocking
- Verify Windows version (10/11 required)
Potential Issues:
-
Conflict with another app
- Try changing to different hotkey
- Check Task Manager for conflicting apps
-
Wrong input source
- Switch between "Selected Text" and "Clipboard Content"
- Manually copy text first (Ctrl+C)
-
Application focus
- Some apps block global hotkeys
- Try in Notepad first to verify it works
Solutions:
- Switch Input Source to "Clipboard Content Only"
- Manually copy text before pressing hotkey
- Check if application allows copying
- Verify text is actually selected
"API key not configured"
- Enter your API key in settings
- Make sure key is saved (no error message)
- Click eye icon to verify key is correct
"API Error: 401"
- API key is invalid
- Get a new key from Google AI Studio
- Make sure key has no extra spaces
"API Error: 429"
- Rate limit exceeded
- Wait a few minutes
- Reduce usage frequency
- Check if you exceeded free tier
"API Error: 500"
- Google server error
- Wait and try again
- Check Google Status Page
Slow corrections:
- Switch to "Fast" processing speed
- Check internet connection
- Google API might be slow (not app issue)
High memory usage:
- Normal usage: 100-200MB
- If higher: Restart application
- Clear history if thousands of corrections stored
- Visual Studio 2022 or later
- .NET 8.0 SDK
- Windows 10/11 development machine
GrammarFixer/
├── GrammarFixer.sln # Visual Studio solution
├── build.bat # Build script
├── README.md # This file
├── LICENSE # MIT License with terms
│
└── GrammarFixer/ # Main project folder
├── GrammarFixer.csproj # Project file
├── App.xaml # Application styles
├── App.xaml.cs # Application entry point
│
├── Windows/ # UI Windows
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── HotkeyDialog.xaml
│ ├── HotkeyDialog.xaml.cs
│ ├── UsageWindow.xaml
│ └── UsageWindow.xaml.cs
│
├── Services/ # Business logic
│ ├── GeminiService.cs # API communication
│ ├── SettingsService.cs # Settings management
│ └── HotkeyService.cs # Global hotkey handling
│
├── Helpers/ # Utility classes
│ ├── ClipboardHelper.cs # Clipboard operations
│ ├── EncryptionHelper.cs # AES encryption
│ └── StartupHelper.cs # Windows startup
│
├── Models/ # Data models
│ ├── AppSettings.cs # Settings model
│ ├── Enums.cs # Enums (Persona, Mode, etc)
│ └── TokenUsage.cs # Token tracking
│
└── Resources/ # Assets
└── icon.ico # Application icon
- Open
GrammarFixer.sln - Set Configuration to "Release"
- Set Platform to "x64"
- Build → Publish Selection
- Choose "Folder" profile
- Configure:
- Target Runtime:
win-x64 - Deployment Mode:
Self-contained - Produce single file: ✓
- Target Runtime:
- Click "Publish"
# Debug build
dotnet build
# Release build
dotnet build -c Release
# Publish standalone executable
dotnet publish -c Release -r win-x64 --self-contained true /p:PublishSingleFile=true
# Using the build script (easiest)
build.batHot Reload:
- Run with
dotnet runfor faster iteration - UI changes refresh automatically
Debugging:
- Check logs in
%LOCALAPPDATA%\GrammarFixer\Logs\ - Use
Debug.WriteLine()for console output - Visual Studio debugger works normally
Testing API Integration:
- Use test API key from Google AI Studio
- Monitor network traffic with Fiddler
- Check
GeminiService.csfor request/response
- Handles application startup
- Manages global exception handling
- Initializes logging system
- Processes command-line arguments (
--minimized)
- Core UI and user interactions
- Settings management
- Hotkey registration
- System tray integration
- Auto-save functionality
- Handles all API communication
- Constructs prompts based on persona/speed
- Parses API responses
- Extracts token usage data
- Error handling for API failures
- Loads/saves user preferences
- Handles encryption/decryption of API key
- JSON serialization
- Manages token usage history
- Validates settings
- Registers global Windows hotkeys
- Uses Win32 API via P/Invoke
- Handles hotkey events
- Allows runtime hotkey changes
- Proper cleanup on exit
- Simulates Ctrl+C and Ctrl+V
- Uses Win32
keybd_eventAPI - Handles modifier key states
- Timing for reliable copy/paste
- AES-256 encryption for API keys
- Generates unique machine keys
- Stores keys securely
- Handles encryption failures gracefully
- Manages Windows registry entries
- Adds/removes from startup
- Handles
--minimizedflag - Checks startup status
1. User presses hotkey
↓
2. HotkeyService triggers callback
↓
3. MainWindow.OnHotkeyPressed()
↓
4. ClipboardHelper copies selected text
↓
5. GeminiService sends to API
↓
6. API returns corrected text
↓
7. MainWindow applies correction (replace/copy/etc)
↓
8. SettingsService saves token usage
↓
9. UI updates with status/stats
Settings Flow:
Load: JSON File → Decrypt API Key → Memory
Save: Memory → Encrypt API Key → JSON File
Auto-Save Trigger Points:
- API key text changed (1 second delay)
- Dropdown selection changed
- Checkbox toggled
- Slider value changed
API Key Protection:
- Never stored in plain text
- Encrypted before saving
- Unique key per machine
- Hidden encryption key file
- Only decrypted when needed
Best Practices Implemented:
- No hardcoded secrets
- Exception handling everywhere
- Secure disposal of sensitive data
- Minimal permission requirements
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Follow coding style
- Use C# conventions
- Add XML comments for public methods
- Keep methods focused and small
- Write meaningful commit messages
- Test thoroughly on Windows 10 and 11
- Update documentation if needed
- Submit Pull Request with description
- Naming: PascalCase for public, _camelCase for private fields
- Async: Use async/await, suffix with "Async"
- Error Handling: Always use try-catch for external calls
- Comments: XML docs for public, inline for complex logic
- 🌍 Multi-language support
- 🎨 Light theme
- ⚙️ Custom prompt templates
- 📦 Batch processing
- 🔌 Plugin system
- 🧪 Unit tests
- 📚 More documentation
This project is licensed under the MIT License with additional terms - see the LICENSE file for details.
- ✓ Free to use, modify, and distribute
- ✓ Commercial use allowed
- ✓ Must include original license
⚠️ Must keep "TheHolyOneZ" attribution in UI⚠️ Cannot remove author name from license
TheHolyOneZ
- GitHub: @TheHolyOneZ
- Project: GrammarFixer
- Google Gemini AI - Powers the grammar correction
- Microsoft .NET Team - Excellent framework and tools
- WPF Community - Inspiration for modern UI design
- Language: C# (.NET 8.0)
- UI Framework: WPF (Windows Presentation Foundation)
- Lines of Code: ~2,500
- Files: 20+
- Dependencies: Minimal (System.Text.Json)
- Multiple language support (Spanish, French, German)
- Light theme option
- Portable mode (no installation)
- Export settings to file
- Custom prompt templates
- Batch text processing
- Markdown support
- Integration with MS Office
- Plugin system
- Multiple AI provider support
- Team/organization features
- Advanced analytics
- Check Documentation - Read this README thoroughly
- Search Issues - Someone may have asked already
- Create Issue - Provide details:
- Windows version
- .NET version
- Steps to reproduce
- Error messages
- Log files
- 🐛 Bug Reports: GitHub Issues
- 💡 Feature Requests: GitHub Discussions
- ⭐ Star the repo if you find it useful!
Made with ❤️ by TheHolyOneZ | © 2025
If you find this project helpful, please consider giving it a star on GitHub!