Get Latitude and Longitude Values from Google Maps

Google Maps will display latitude and longitude values, and there are several methods to obtain these numbers. These techniques will provide the latitude and longitude coordinates for any location on the map. This article has been revised for the latest version of Google Maps.

Previously, users had to paste custom JavaScript into the URL box of Google Maps to be able to display the latitude and longitude of an address. With the latest version of Google Maps, this is no longer required.

Finding Latitude and Longitude Directly

1To begin with, search for your desired location as you normally would.

Search For Desired Address

2Next, right click the red “A” pin displayed on the map. Select What’s here?

What's here?

3Once you’ve clicked What’s here?, Google Maps will automatically display the (latitude, longitude) pair in the Address search bar at the top of the Google Maps page.

Lat/Long Displayed In Search Bar

Previous Javascript Method

Looking up an address in Google Maps will center the map on that address if it was found. Because this trick provides the latitude and longitude of the center of the map, moving the map around manually after that will change the center position and this technique will not work accurately.

When the location you want is in the center of the map, copy and paste this code into the location bar of your browser and press enter:


A little dialog box will pop up displaying the coordinates which can be copied and pasted for use elsewhere. This code can be bookmarked and then used in the future by selecting the bookmark.

If these methods don’t help you with all, we also have other methods for finding latitude and longitude.


About Aaron St. Clair

Aaron St. Clair is a tech guru studying Computer Science at Appalachian State University in Boone, North Carolina. When he's not tinkering with new gadgets, modding systems, or slaving away at the mercy of the Tech-Recipe overlords, you can find him exploring the high country.
View more articles by Aaron St. Clair

The Conversation

Follow the reactions below and share your own thoughts.

  • Anonymous

    I have been looking for this forever! Thank you So much for posting this. You have just made my life so much easier!

  • fred

    very nice tip, cheers

  • Gary

    Works nicely. Thanks.

  • Grate dude

  • Kyle

    nice, thank you

  • Mike

    So, I centered the Google map and then copied and pasted some kind of code into my browser. I started with Morse code. Since I had nothing but time, I actually wrote out “dot” and “dash” as I entered the code. I encounted one problem. I do not know Morse code. Anyway, I entered ” javascript:void(prompt(”,gApplication.getMap().getCenter())); ” into my browser. At first there was this slight odor of melting plastic. Then I noticed smoke. So I shut off my computer. Then I thought, Hey Mike, why not go out and by a GPS system. I figured that had to be easier than trying to figure this out, though probably more difficult than advanced Geometry. So that’s what I did. And I was right, it was easier.

    • Vancler2000

      If you think that going out, spending time and money, and getting a GPS is easier than typing a line of code into your web browser address, than… actually I’m at a loss for words on this one. Works perfectly and it’s more accurate, cheap and faster than buying a GPS. 🙂

      • BillybobWilliamRoberts

        Do you think he cares….2 years later?

  • Debbie

    Great tip! Did exactly what I needed! Not easy getting some locations to map into the Google maps plug-in for WordPress.

  • Amazing and yet so simple, thanks for this tip!

    I’m surprised Google don’t just display this in an easy to see location for people.

  • Thanks a lot. Been trying to find the exact location of my house.

  • Cristian Palmas


    I tried to use the code but I failed. Perhaps I misunderstood what is “the location bar of your browser”. Can you explain further what “location bar” is?

    • bRo

      The location bar is the area up at the top of the browser where you can type in the location of a web address. For example, when you visit, you will notice an area up at the top that displays “”. That area is the location bar.

  • FreakEROS

    Thank you very much!!! =]

  • Prasad

    Thank you very much for this. It works and really helpful. I have been looking for this from long time. Earlier, Google maps used to display the GPS position if you drag the location marker off the requested location on the map. I don’t know why one fine day Google stopped displaying the GPS position on the map. It only displays the street name now.

  • johan

    sorry to dissapoint you all, but it does not display degrees, minutes and seconds, it displays degrees and decimal fractions of degrees….

    • The whole units of degrees will remain the same (i.e. in 121.135° longitude, start with 121°).

      Multiply the decimal by 60 (i.e. .135 * 60 = 8.1).

      The whole number becomes the minutes (8′).

      Take the remaining decimal and multiply by 60. (i.e. .1 * 60 = 6).

      The resulting number becomes the seconds (6″). Seconds can remain as a decimal.

      Take your three sets of numbers and put them together, using the symbols for degrees (°), minutes (‘), and seconds (“) (i.e. 121°8’6” longitude)

  • lanes

    yup, it does work for me.
    thanks man

  • Peter

    “the location bar of your browser”… is the place on your web browser where you type the web address, web link, URL, or URI. It’s >not

  • waqas

    just one word – awesome……..and not just cheers… also beers lol

  • Miguel

    Excellent tip, I am using it now, my work is easier.
    Thank you.

  • Ankur

    Awesome man…this trick really worked n helped me a lot.

  • Fei Chen

    It helps, thanks a lot!

  • Joe

    Very nice tool. This came in very handy. Thanks.

  • Tobes

    great, thanks for that. T

  • Lester

    Good jobs! Help me a lots….

  • divayouknow

    worked like a charm- thanks!

  • Sameer


  • Sameer

    Thansk Working for me

  • Doesnt work for me…. so when I got my location in centre it was :

    And dis you mean I just add that code at the end of the address or should I do something prior?

  • sfsdf

    doesn’t work

  • apps


  • Frank

    works perfectly.

  • Robert

    Location bar? WTH?
    Can you paste an example for us???

  • Anonymous

    But why doesnt it work with windows vista? is there a different version for that?

  • This all works very nicely but you can also search an address in Google then right click on the pin and choose What’s Here? and it will display the lat and long in the query input field. Nice because you can cut and paste that into another app.

    • Actually right-click on the pin does not get you the center of the map except by mere chance. Instead, it gives you the coords where you right-clicked. You can confirm this by clicking different parts of the pin and comparing the results to the javascript method that is the subject of this thread.

  • Paul

    Great very useful for plotting routes with a GPS

  • Anonymous

    cool…thx a lot

  • nick

    you rule!!!!!!!!!!!!!!!!!!!!!!!

    works “just fine”(perfect to be exact ; ) !!!

    i wonder why is it so freakin’ hard for google to provide this info anyway…could it be $ issues ; ( ?

    a big thanks!!!

  • Anonymous

    Thanks foe the informatiom

  • Anonymous

    Thanks for this hint it was very useful.

  • SpyBlogger

    Wow I needed it a lot!

  • Anonymous

    Great, thanks! Anyone know how to get it to display UTM rather than lat/long?

    For those struggling to make this tip/recipe work, try this: copy the javascript snippet. Open bookmarks -> organize bookmarks (in firefox – not sure how to do it in other browsers). Click ‘organize’ -> ‘new bookmark’. In ‘name’ type whatever you want. In ‘location’ paste the javascript. Click ‘ok’. Close the bookmark organizer. Go back to google maps, centre the map wherever you want, then go to your bookmark menu and select the bookmark you just created. A popup window will appear with the latitude and longitude of the centre of the map.

  • Amazing! Very simple and works great! Thanks for the great tip.



  • wow kool, I didn’t know it was so easy to find long and lat. I used to read them from the embed code.

  • Sergio

    Works fine for Internet Explorer 8. Thank you, thank you, thank you!

  • Anonymous

    Thanks, works for me 🙂

  • Yes, tucsonjhall’s idea is easier now. Right-click on the spot, choose “What’s Here?” and you’ll be given the coordinates, as well as what name Google associates with the place. For example, clicking on my university building gives the name of surrounding streets, depending on what part of the building you click, since the building isn’t in their database.

  • Thanks bunch! Worked fine for me as well. Wondering why google does not provide that as a feature…

  • The only problem is this may not be accurate.

    Try to resize the window and run this script again. See that the values are different. The values seem to be dependent on the size of the browser window, which is bizarre.

  • Anonymous

    How do I turn longitude and latitude off with google maps?

    Thanks for your assistance

  • This is really handy. Suggested improvement: Turn the above code into a link so readers can drag-and-drop it as a bookmarklet into their toolbars.

  • Anonymous

    awesome tip, thanks.


  • Thanks for this!

  • Steve

    thanks, nice trick!

  • flo_sb

    just go to desired location , right click it and then select “what’s here?”
    mouseover and read coords

  • Sherif Halim

    very smart! thanks

  • Pjwannys

    It works…but only if you FIRST pull down the google bar “pop-up blocker” tab and select “always allow popups from Google Mpas.” Very useful, but ultimately, for my purposes (sending to my android navigation via email to myself) it is better to click the “link” tab and cut & paste this into the email.

    Then, when out in the field, no need to search for a spot – merely open the gmail with the link embeded and click on it and – off you go…

  • Pjwannys

    That should read Google Maps” rather than “Mpas” anyway, thanks for this nifty tip. Very useful when helping my 6th grader do geography reports, etc.

  • warley996

    thnks man!,

  • Works perfect| beautiful trick / thanks for sharing it

  • Wow, I tried it and it really work for me.. Thx a lots 😉

  • Paul Abarge

    does not work. forget it.

  • Not very precise (ironically), if you try to do the math to convert this to minutes and seconds. I wound up wildly off from the original location. Use with caution.

  • Works great thanks!

  • Mira

    Works for me. Thanks!

  • LarryRules2010


  • Nizam Sp

    Great one.. If I want to automate it. (For example, given a search word, I need lat long). Any Idea guys??

  • Wow, I did not expect this to work. I had no idea you could pass javascript through the address/location field that way and have it “interact” with the website. I plan on using this to add geotagging to some content on my personal site.

  • Researcher

    Thanks! Is it possible for a bash or python script to query Google maps and get the returned values? That would be very helpful for our work, and save a lot of time.

  • Wai

    The author of this needs to be awarded Nobel Prize for this! This is awesome!

  • Chathura Asanga

    You can do this very easier than this.

    1) Right click on the required point of the google map
    2) select “What’s here?” from the pop up menu.
    3) Focus the mouse pointer to that point again

    You can see both Latitude and Longitude as a tooltip!!!

  • Chathura Asanga

    You can do this very easier than this.

    1) Right click on the required point of the google map
    2) select “What’s here?” from the pop up menu.
    3) Focus the mouse pointer to that point again

    You can see both Latitude and Longitude as a tooltip!!!

    Also you can see the coordinates on the title bar of the browser!!!

  • Shahroon

    i have used the map in my website,now i want it to be pointed on my city when the page loads for the first time..the map is centred on australia’s some location as done in the tutorial given at google’s developer section.Is latlng the function,by changing the values i can get to my own city whenever i open it…do i need to specify that in the code? tell me any easy way..thanks

  • Jivan

    Fantastic, Chathura Asanga!!! Thanks!

  • Trevor

    Thank you! I knew there had to be a better way to do this than squinting at the link url, but it has been elusive.

  • diwan-site-web

    thank you very much for this tuto

  • lagat

    I would like to change long and lat into api address, eg
    any help?

    • I’m not sure what you’re asking. An API Address? Google Maps no longer requires an API Key.

  • lagat

    I want to change a google map into an excel datasheet/access datasheet format, how should i go about it? thanks

  • Sam

    Awesome…excellent tip. the map labs: LatLng Marke doesnt work. #fail

  • Giggantic

    I didn’t realize that it is this simple.. what a noob I am 😀 hahaha
    thanks anyway! you rock!

  • table top displays

    I enjoy, cause I found exactly what I was taking a look for. You’ve ended my four day lengthy hunt! God Bless you man. Have a nice day. Bye

  • Shiju

    Thank u for all ur tip, it has helped me a lot…

  • Escalate SEO

    Well, I did not know it was that easy. Thanks a lot for posting this information.

  • Abdul Basith

    I want to show map in osm by passing latitude and longitude as destination and also my current location too….to using offline…..

    • I’ve never used OpenStreetMap before, so I really don’t know how to do it using their system… Sorry.

  • DynV

    This is a very quick and efficient method. Thanks for giving the JS snippet in case the feature is taken off.

  • Gregory

    Good! Thank you. Saved my time)

  • aarif

    how to get latitude and longitude numbers via google maps on android phone

  • toko pusat

    this method can’t used anymore , anyone can help me ?