How to copy text from a screenshot or image

Error dialogs, images in a bug report, slides in a video call: text you can see but can't select. Recognizing it (OCR) can run on your own computer, so there is no need to upload it anywhere.

Windows

macOS

Live Text, built into macOS Monterey and later in apps such as Preview, Photos and Quick Look, lets you select text in an image directly. Open the screenshot, then drag across the text like any other text.

Linux

Linux has no built-in equivalent, but Tesseract does the recognition and you can wire it to a region capture. Install tesseract-ocr and a clipboard tool, then:

Wayland (needs grim, slurp, wl-clipboard; works on wlroots-based compositors such as Sway):

grim -g "$(slurp)" - | tesseract - - | wl-copy

X11 (needs maim and xclip):

maim -s | tesseract - - | xclip -selection clipboard

GNOME on Wayland doesn't expose grim's capture interface, so on GNOME take a screenshot with the built-in tool first and run tesseract screenshot.png - on the file.

One shortcut on every platform: GrabCanvas

  1. Press Ctrl + Shift + 6 (⌘ + ⇧ + 6 on macOS).
  2. Drag over the text.
  3. Paste it into a search, a ticket or a terminal.

Recognition runs on your computer with no network call, and line breaks are kept, so a pasted stack trace still reads as a stack trace. Error codes, file paths and URLs are the cases it is tuned for. It also works on text in paused video and PDFs rendered on screen.

Tips for better results

Copy text from any screen

Part of the free trial. $29 once, or claim a free launch license.