How to copy text from a screenshot on Linux
Linux screenshot tools save images, not text, so you need an OCR program. Tesseract is the standard engine, and tools like NormCap, Frog or gImageReader put it behind a simple interface.
Most Linux desktops can take a screenshot out of the box. On GNOME (Ubuntu, Fedora), press Print Screen. On KDE Plasma, Spectacle does the same job. Neither turns the picture into copyable text, and ShotBox has no OCR either, so you need one of the tools below.
Option 1: Tesseract on the command line
Tesseract is a widely used open source OCR engine and is available in most distributions.
- Install it. On Debian or Ubuntu: `sudo apt install tesseract-ocr`. On Fedora: `sudo dnf install tesseract`.
- Take a screenshot and note the file path.
- Run: `tesseract screenshot.png stdout`
- The recognized text prints in the terminal. Copy it, or save it with `tesseract screenshot.png result` which creates `result.txt`.
For languages other than English, install the matching language pack and add `-l` with the language code.
Option 2: A screenshot to clipboard workflow
If you take many screenshots, you can pipe the capture straight into Tesseract. With Flameshot on X11, for example:
`flameshot gui --raw | tesseract stdin stdout | xclip -selection clipboard`
On Wayland, swap `xclip` for `wl-copy` and use a capture tool that works on your compositor. You can bind a command like this to a keyboard shortcut in your desktop settings, so one key press captures an area and puts the text on the clipboard.
Option 3: A graphical OCR tool
If you prefer clicking over typing commands, these are good choices:
- NormCap: select an area of the screen and the text lands on your clipboard.
- Frog: a GNOME app that extracts text from images and screenshots.
- gImageReader: a graphical front end for Tesseract that handles whole images and PDFs.
Availability varies by distribution. Check your package manager, Flathub or the project pages for install instructions.
Where ShotBox fits
Once you have the text, you may still want to send the screenshot itself to someone. ShotBox is a web app, so it works in any Linux browser with nothing to install.
- Take the screenshot with your usual shortcut.
- Open ShotBox and press Ctrl + V, or drag the file in.
- Hide private details with the pixelate blur, and crop or mark up the image.
- Upload to get a long random private link, copied automatically. It is not listed and not indexed.
- Set the link to expire after 1 hour, 1 day, 7 days or 30 days, or delete it any time.
Camera and GPS (EXIF) data are removed from every image. You can share by link, copy image, QR code, or embed codes (Markdown, HTML, BBCode). If you sign in with Google, a screenshot uploaded from your phone appears on your computer within seconds. A small sync script for Linux can also save every screenshot into a folder.
Tips for better OCR results
- Capture at the screen's native size or larger. Scaling an image down hurts accuracy.
- Dark mode text on dark backgrounds can fail. Try a light theme for the capture.
- Crop to just the text before running OCR.
- Always proofread. Characters like 1, l and I are easy to confuse.
Frequently asked questions
What is the best OCR tool for screenshots on Linux?
Tesseract is the most common engine. For a point and click experience, NormCap or Frog are easy to use, and gImageReader suits larger documents.
Can I copy text from a screenshot without installing anything?
Not on most Linux desktops, since the built-in screenshot tools do not include OCR. A browser based option may work in some cases, but a local tool like Tesseract keeps your image on your own machine.
Does ShotBox read text from images?
No. ShotBox has no OCR. It handles editing, blurring, private links with expiry and syncing, so pair it with an OCR tool if you need the text.
Does this work on Wayland?
Yes, but clipboard and capture tools differ. Use wl-copy instead of xclip, and a screenshot tool that supports your Wayland desktop.
How do I share a screenshot privately on Linux?
Paste or drop it into ShotBox, blur sensitive parts, and upload. You get a long random private link that is not indexed, and you can choose when it expires.