codeOCR is an open-source image recognition utility designed to be highly accurate in recognizing and parsing code from images. It excels where traditional OCR tools falter, boasting up to 90% higher accuracy in identifying programming languages and preserving the original structure, indentation, and syntax of code snippets.
This tool is implemented as a browser extension with a powerful Go backend, providing a seamless experience for developers to extract code from screenshots, online tutorials, or any image source directly within their browser.

Follow these steps to set up and run codeOCR locally.
- A modern web browser that supports extensions (e.g., Google Chrome, Mozilla Firefox).
- Go (version 1.x or higher) (For compiling the server file)
To improve the processing speed of the OCR, you can run the extension with a local backend.
- Clone the repository:
git clone git@github.com:Vladicki/codeOCR.git cd codeOCR
- Give execution permission to the main binary
chmod +x local_backend/main
- Run the local server
./local_backend/main
- Create a
.env
file in the root of the project and add your Gemini API key to it:GEMINI_API_KEY=your_api_key
- change localendpoint in background js to localhost:8080:
The server will start and listen for requests from the browser extension.
//Uncomment const apiEndpoint = "http://localhost:8080/process-image";
- Open your web browser (e.g., Google Chrome).
- Navigate to the extensions page (
chrome://extensions
). - Enable "Developer mode" (usually a toggle in the top right corner).
- Click on "Load unpacked".
- Select the root directory of this project (
/path/to/codeOCR
). - Press (Alt+C/ ⌘+C) to Capture process your cod snippet. The codeOCR extension icon should now appear in your browser's toolbar. You can also pin it to the tool bar and now use it to capture code from images on any webpage.
- Open your browser of choice.
- Navigate to the extensions page.
- Enable "Developer mode".
- Click on "Load unpacked" and select the extension's folder or the
manifest.json
file.