Sumatra PDF is a PDF, ePub, MOBI, CHM, XPS, DjVu, CBZ, CBR reader for Windows

Google-search a word/phrase with right-click

People often encounter difficult words, esp in:

  • textbooks (including those people need to read to see if they’re getting the right dental/medical treatment)
  • old books
    It would be incredibly useful to me to be able to right-click a word, and tap one button to do a google search on that word.

PS I’ve been using Sumatra for awhile now and I love how light-weight it is.

1 Like

Ideally speaking the search engine would be configurable, for those who’d rather not use Google. That way we can specify something like and Sumatra would replace %s with proper encoded text before invoking the default browser.

1 Like

Also requesting that feature.

Documents often need further explaining for which nothing is easier than highlight and right mouse search.

Relevant list of GitHub issues can be found below (so more duplicates aren’t created).

Based on comments and right button search request by Tim_Marshall + @ than

I thought some of you might like to test out the following simple AHK code
just save it as say SEARCH.AHK

[UPDATE] there is an alternative method using Windows scripting (no need for AutoHotKey) in thread [Advanced Tips] Pass selection to another app e.g. Web Search

; Web lookup for any text including SumatraPDF
; Highlight some text then press Alt & Right Button


; Save and clear clipboard
StoredClipboard := ClipboardAll
Clipboard:= ""

; Send copy command (^c) to collect selected text
SendInput, ^c
; Wait a mo
ClipWait, 1


; Reset Clipboard
Clipboard := StoredClipboard

Save the above version or right click here to download a similar version by Nod5 as described later you can replace the startpage line with your preferred search engine e.g.


you can even change browser

Run "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ""

NOTE:- that’s all on one line and in this case the search needs to be enclosed in quotes

you can also try


or a translator or dictionary or … let your imagination take you there

If you don’t have latest portable AutoHotKey Zip
Download from

save zip file currently (April 2014) its
extract its contents and drop SEARCH.AHK onto

Tested with XP up to Win8.1 Pro x64 using several browsers etc.
(can’t test on Win 10 at present) if all is well there will be a green H icon in the Icon tray

If you want a second choice such as translate you can add to the end of the above text (after the return) this section

; Web translate for any text including from within SumatraPDF
; Highlight some text then press AltGR Key (that's the alt key to right of spacebar)


; Save and clear clipboard
StoredClipboard := ClipboardAll
Clipboard:= ""

; Send copy command (^c) to collect selected text
SendInput, ^c
; Wait a mo
ClipWait, 1


; Reset Clipboard
Clipboard := StoredClipboard

How many such workarounds does one keep accumulating over time as Band-Aids to missing functionality in a program? Anyway, as I’ve said earlier you are free to use AHK or anything else as stopgap measures and so are others, and my personal preference has no bearing on it.

BTW you’ve used StoreClipboard once and then StoredClipboard.

Also, a “StoredClipboard =” at the end might be useful in order to free up memory in case the clipboard’s original content was quite large.

1 Like

Thanks Peter,

Think of it as an extension (Band-Aid) to windows outside of SumatraPDF

Well spotted. I have changed code above so both read as StoredClipboard , not so logical at start but hopefully indicative, the intent was to preserve users current clipboard contents so it can be restored (no matter how big it was)

Also have expanded examples again
what’s everyone’s favourite choice of look-up?

I prefer DuckDuckGo.

Favourite look-up has to be Google for me

I downloaded the .zip file, unpacked it and it looks like this
in my folder-

Which one would be the SEARCH.AHK ?

Read the thread carefully:


would it be possible to add a context menu search for selected text where optionally a user defined search engine could be set in advanced options?


Requested multiple times, and rejected at least once:

Edit: All consolidated under the following now:

Feature Request: Select, right-click, paste to Google

Would be very handy.

For now, you can check above or here for AutoHotkey scripts to implement this.

Maybe add a shortcut which allows users to search the selected text online if possible, just like the ones that are built in edge and chrome.

A shortcut on the right-click menu can be better :smile:

can anyone explain in simple way how to get this this working? I am new to this. Thanks


It is probably easier to use the method shown in the earlier link [Advanced Tips] Pass selection to another app e.g. Web Search it is less automatic but potentially simpler as it uses one windows script file combined with an edit to the Advanced settings file