How to Extract Text From an Image on Linux (Without Installing Anything)

To extract text from an image on Linux, open a browser-based image to text converter, upload the picture, and copy the text — no install or terminal needed.

Linux can do almost anything, but copying text out of a picture is oddly awkward on it. Windows has Snipping Tool text actions, macOS and iOS have Live Text, and phones have Lens built in; most Linux desktops ship nothing comparable. The tools that do exist are powerful — the same Tesseract engine behind most free OCR was born on the command line — but their guides assume you are comfortable with a terminal and a root password, and many Linux users are on work or school machines where they cannot install anything at all.

This guide covers the range in the order you should try it: the no-install browser route, the Tesseract command line, the gImageReader front end, and the Google Drive fallback, then the accuracy fixes and the cases where OCR still struggles.

The Four Ways to Extract Text From an Image on Linux

The right method depends on how often you do this, whether you can install software, and what kind of image you have.

MethodInstall neededBest forWatch out for
Browser converterNoneOne-off images, locked-down machines, any distroNeeds internet; very large batches are slow
Tesseract command lineYes (tesseract-ocr)Regular use, batches, scripts, serversTerminal required; no visual preview
gImageReader (GUI)YesPeople who want buttons, not commandsFewer distros package it cleanly
Google Drive OCRNone (Google account)Images already in Drive; scanned PDFs2 MB file limit; formatting mostly lost

If you only need the text from one image today, use the browser converter and stop at the end of the next section. If you do this every week, read the Tesseract section. The two are not rivals: the same engine, different interfaces, and many people use both.

Method 1: Use a Browser Converter (No Install)

This is the fastest route, and it works identically on every distribution — Ubuntu, Fedora, Arch, Debian, Mint, Pop!_OS — because the work happens in the browser. It also works where you have no administrator rights: a library computer, a borrowed laptop, a locked-down work machine.

  1. Open the converter. Go to the image to text converter in Firefox or Chrome — nothing to download, no account to create.
  2. Upload the image. Drag the file onto the page or click to browse. JPG and PNG both work; a photo, a screenshot, and a scan are all fine.
  3. Wait a few seconds. The converter reads the picture and shows the recognised text underneath it — editable, so you can fix misreads before copying.
  4. Copy the text and paste it where you need it. A text editor, an email, a document — anywhere plain text goes.

That is the whole method. Behind the scenes, the converter runs Tesseract — the same open-source engine as the command-line tool in Method 2 — inside your browser, so the results match installing it. The difference is only the interface: buttons instead of commands, and no system changes at all.

This route is also the honest answer for a screenshot of an error message, one of the most common Linux OCR jobs: take the screenshot, upload it, and paste the error into a search engine or a forum post. Our guide on converting a screenshot to text walks through the screenshot part, and the Chromebook screenshot guide covers the same job on ChromeOS.

When the browser route is the wrong choice: hundreds of images, no internet connection, or sensitive material you would rather not upload. For those cases, the local tools below are better.

Method 2: Tesseract on the Command Line

If you convert images regularly, installing Tesseract is worth it. It is free, open-source, and in every major distribution's repositories. It recognises about 100 languages, reads JPG, PNG, TIFF, and BMP, and can be scripted, so a folder of 200 images becomes one command.

Install Tesseract

The package name differs by distribution:

DistributionInstall command
Ubuntu, Debian, Linux Mint, Pop!_OSsudo apt install tesseract-ocr
Fedora, CentOS, AlmaLinux, Red Hatsudo dnf install tesseract
Arch Linux, Manjarosudo pacman -S tesseract

Confirm it with tesseract --version. If the command is not found, re-run the install and read the error.

Extract text from one image

The syntax is the input image, then the output name without an extension — Tesseract adds .txt itself.

tesseract photo.png notes

This reads photo.png and writes notes.txt in the same folder, overwriting without asking. Read it with cat notes.txt or any text editor.

Two options cover most problems. The first is resolution: if Tesseract warns about invalid resolution or produces garbage from a clean image, state the dpi — scans are usually 300 dpi, phone photos often carry none.

tesseract photo.png notes --dpi 300

The second is language: Tesseract reads English by default. For another, install its data file and pass its code with -l — German is tesseract-ocr-deu on Ubuntu and Debian, French fra, Spanish spa.

sudo apt install tesseract-ocr-deu
tesseract brief.png brief-de -l deu

A document mixing two languages takes both codes joined with a plus sign (-l eng+fra), and tesseract --list-langs shows what is installed. Our guide on multi-language OCR explains the language question in more depth.

Extract text from a whole folder

One loop converts every PNG in a folder, writing one text file per image:

for f in *.png; do tesseract "$f" "${f%.png}" --dpi 300; done

The ${f%.png} part strips the extension, so invoice-01.png becomes invoice-01.txt. Change *.png to *.jpg for JPEGs. The same batch idea in a browser is covered in our guide on converting multiple images to text at once.

Extract text from a scanned PDF

Tesseract cannot read PDFs — only images. Convert each page first with pdftoppm, which ships with poppler-utils and is often already installed:

pdftoppm -png report.pdf page
for f in page-*.png; do tesseract "$f" "${f%.png}" --dpi 300; done

This leaves one text file per page. To keep the PDF and make it searchable instead, use OCRmyPDF, which adds a searchable text layer while keeping the original pages. Our guide on converting scanned PDF pages to text covers the page-by-page route.

A terminal running Tesseract next to the text it extracted

Method 3: gImageReader, the Point-and-Click Front End

Tesseract on its own has no window to click in. gImageReader is a graphical front end for the same engine: the picture on one side, the recognised text on the other, and you can select a region to convert instead of the whole image. Install it together with Tesseract:

DistributionInstall command
Ubuntu, Debian, Linux Mintsudo apt install gimagereader tesseract-ocr
Fedora, CentOS, AlmaLinux, Red Hatsudo dnf install gimagereader-qt tesseract
Arch Linux, Manjarosudo pacman -S gimagereader-qt tesseract

To use it:

  1. Open gImageReader from your application launcher.
  2. Add the image with the green plus icon, or drag the file into the window.
  3. Choose the language if the text is not English — the data must be installed, as in Method 2.
  4. Click "Recognize all" to convert the whole image, or drag a box around part of it to convert only that region.
  5. Read the text in the right-hand pane, correct it, and copy it out or save it.

gImageReader suits a few conversions a week with picture and text side by side. It is the wrong choice for a folder of images unattended — that is what the command line is for — and where the package is missing, the browser converter in Method 1 is the simpler fallback.

Method 4: Google Drive OCR (No Install, Google Account Needed)

If your image is already in Google Drive, Drive has a built-in OCR step that needs no software at all — Google documents it on its support pages, and it works from any Linux browser:

  1. Upload the image to Google Drive. JPG, PNG, GIF, and PDF files are supported, and the file should be 2 MB or smaller.
  2. Right-click the file and choose Open with, then Google Docs.
  3. Wait for the conversion. Drive opens a new Google Docs document with the recognised text, usually below the image.
  4. Copy the text into your own document.

Know the limits before you rely on this. Text should be at least 10 pixels high, and the page must be the right way up — rotate it before uploading if it is sideways. Bold, italics, font size, and line breaks are usually kept, but lists, tables, columns, and footnotes are usually not detected. Handwriting is not documented as supported, and the method needs a Google account and sends your file to Google's servers.

Taking the Screenshot in the First Place

Half of Linux OCR jobs start with a screenshot: an error message, a chat window, a video frame, a form that cannot be copied.

  • GNOME (Ubuntu, Fedora Workstation): Print Screen for the whole screen, Shift + Print Screen for a selected area.
  • KDE Plasma (Kubuntu, Fedora KDE): Spectacle, usually on Print Screen, adds a delay timer, which helps when you need a menu open in the shot.
  • Any desktop: Flameshot, installable from most repositories, lets you draw the region, annotate it, and copy it to the clipboard.

Save the screenshot as PNG rather than JPG when you have the choice: PNG is lossless, so letter edges stay sharp, while JPG compression softens them. Then upload the file to the browser converter, or hand it to Tesseract. The screenshot-to-text guide covers the conversion step, and the Windows and Mac guide is useful if you switch between machines.

Getting Better Accuracy From Any Method

The engine matters less than the image: a clean picture converts well, and no setting rescues a bad one.

  1. Fill the frame with text. Crop out the desk, the wall, and the margins before converting — anything that is not text is a chance to misread something.
  2. Shoot straight on. Hold the phone parallel to the page. A photo taken at an angle shrinks the far edge and leans every line.
  3. Use even light and no flash. Daylight from a window is best; a ceiling light or phone flash puts a bright stripe across the page.
  4. Check the resolution. Aim for 300 dpi: the text should be large and sharp when you zoom in. If you cannot read a word, the converter cannot either.
  5. Pick the right language. A German page read as English produces confident nonsense. Install the language data and pass it with -l, or select it in the GUI before converting.
  6. Proofread the result. OCR reads shapes, not meaning, so it can turn "rn" into "m", "0" into "O", and "1" into "l" without noticing. Check the output against the original, especially numbers, names, and prices.

Our guide on how to improve OCR accuracy covers twelve such fixes with examples, including contrast tricks for faded print and low-contrast scans.

What OCR Still Gets Wrong on Linux (and Everywhere Else)

Knowing the limits tells you when to stop fighting the converter and change the job instead.

  • Handwriting. Printed text is what OCR is built for. Neat handwriting sometimes works; cursive and hurried notes usually do not. Our handwriting guide sets out honestly what can and cannot be read.
  • Tables. A table's meaning lives in its rows and columns, and plain-text output flattens them. If the structure matters, read the table extraction guide instead.
  • Formatting. Bold, italics, headings, and columns mostly do not survive. If the layout matters, the guide to extracting text without losing the formatting explains what can be preserved and what must be rebuilt by hand.
  • Low-resolution images. A thumbnail or a photo taken from across the room does not contain enough pixels per letter. Re-take it closer, or accept heavy correction.
  • Decorative and script fonts. Wedding invitations, chalkboards, and fancy display type confuse the reader. Plain body text is its home ground.
  • Mixed content. A page half diagram and half text, or a screenshot with a video behind the words, gives the reader shapes it cannot classify. Crop to the text first.

Frequently Asked Questions

Do I need to install anything to extract text from an image on Linux?

No. A browser-based image to text converter works on every distribution with nothing to install, and Google Drive OCR works the same way with a Google account. Install Tesseract only if you convert images often, want to work offline, or need to process folders at once.

Is there a built-in Linux equivalent of Windows Snipping Tool text actions or macOS Live Text?

Not one that ships with every desktop. GNOME and KDE have screenshot tools, but they capture pictures, not text. The closest option is installing Tesseract — one command on Ubuntu, Fedora, and Arch — or using the browser converter, which needs no install.

Can Tesseract read handwriting?

Poorly, in most cases — it is trained for printed text. Neat, separated handwriting sometimes converts; cursive rarely does. Try a short sample first.

Is it safe to upload images to an online converter?

For ordinary material — a menu, a flyer, a public notice — yes. For private material such as contracts or medical records, prefer a local tool: Tesseract and gImageReader process the image on your own machine and send nothing anywhere.

The Short Version

To extract text from an image on Linux, use a browser-based image to text converter for a one-off image: upload, copy, done — on any distribution with no install and no administrator rights. If you do this every week, install Tesseract (sudo apt install tesseract-ocr on Ubuntu and Debian, sudo dnf install tesseract on Fedora, sudo pacman -S tesseract on Arch) and run tesseract photo.png notes, adding --dpi 300 and -l for the language. gImageReader gives you the same engine with buttons instead of commands, and Google Drive OCR covers files already in Drive. Whichever route you take, spend the effort on the picture — straight, well-lit, cropped tight.

References

← All guides