Stay organized with collectionsSave and categorize content based on your preferences.
European Economic Area (EEA) developers
Introduction
TheRouteMatrixclass returns distances and travel times for a matrix
of routes between different origin and destination locations. Calculate travel times and
distances for multiple destinations for up to 625 route elements.
Need Driving Routes?If you are interested in route directions, use theRoute class.
Migrating?If you are migrating from the Distance Matrix Service (Legacy)
to theRouteMatrixclass, seeMigrate to the Route Matrix class.
Why use theRouteMatrixclass?
With theRouteMatrixclass, you can determine the most efficient routes for dispatch
scheduling, such as:
How best to assign a set of workers to pick up a series of packages
Determine the best warehouse from which to ship packages to their final destination
What can you do with theRouteMatrixclass?
With theRouteMatrixclass, you can get a matrix of possible
routes between many start and end locations. You can specify multiple origins and
destinations per server-side request with the number of origins times the number of
destinations up to 625.
You can request these kinds of route data to determine the most efficient way to route
passengers, shipments, or workers between multiple origins and destinations:
Distance in kilometers or miles for a selected travel mode
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-08 UTC."],[],[],null,["**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](/maps/comms/eea/faq).\n\nIntroduction\n\nThe `RouteMatrix` class returns distances and travel times for a matrix\nof routes between different origin and destination locations. Calculate travel times and\ndistances for multiple destinations for up to 625 route elements.\n\n**Need Driving Routes?** If you are interested in route directions, use the\n[Route class](/maps/documentation/javascript/routes/route-class-overview).\n\n**Migrating?** If you are migrating from the Distance Matrix Service (Legacy)\nto the `RouteMatrix` class, see\n[Migrate to the Route Matrix class](/maps/documentation/javascript/routes/route-matrix-js-migration).\n\nWhy use the `RouteMatrix` class?\n\nWith the `RouteMatrix` class, you can determine the most efficient routes for dispatch\nscheduling, such as:\n\n- How best to assign a set of workers to pick up a series of packages\n- Determine the best warehouse from which to ship packages to their final destination\n\nWhat can you do with the `RouteMatrix` class?\n\nWith the `RouteMatrix` class, you can get a matrix of possible\nroutes between many start and end locations. You can specify multiple origins and\ndestinations per server-side request with the number of origins times the number of\ndestinations up to 625.\n\nYou can request these kinds of route data to determine the most efficient way to route\npassengers, shipments, or workers between multiple origins and destinations:\n\n- Distance in kilometers or miles for a selected travel mode\n- Estimated travel time in traffic\n\nNext steps\n\n- [Get started](/maps/documentation/javascript/routes/start)\n- [Get a route matrix](/maps/documentation/routes/get-route-matrix)"]]