ZIP Code Distance Calculator

How far apart two places are, the drive, the time difference, and the two compared side by side.

Toronto, ON M5V is about 222 miles southwest of Ottawa, ON K1A 0A1

In a straight line between the centers of the two codes: 222 miles (357 km).

Straight line222 mi357 km
By roadFinding the drive…Mapbox, no traffic
DirectionSouthwestheading 237° at the start
Time differenceSame timeall year
A Ottawa, ON K1A 0A1 B Toronto, ON M5V Straight line The drive
Ask your AI assistant about both places. Connect Claude or ChatGPT in a few steps. Try a Question

Ottawa and Toronto side by side

Census figures are for U.S. ZIP Codes only, so a Canadian postal code has none to compare.

MeasureA OttawaB Toronto
CityOttawa, ONToronto, ON
Time zoneEasternEastern

Ask your AI assistant about these two places

Connect Claude or ChatGPT to our ZIP Code data, then ask questions in plain English. No sign-up with us needed.

Once you're connected, try this:
“How far is Toronto, ON M5V from Ottawa, ON K1A 0A1, in which direction, and what is the time difference?”

This question answers in full without a key.

New to this? We'll walk you through it, one step at a time.

Developer tools: Claude Code, Cursor, VS Code, Codex
Questions about these two places (full answers need a free API key)
“What are the ZIP Codes within 10 miles of M5V?”
“What county, metro area and area codes is M5V in?”
Get a Free API Key 2,500 credits a day, free. Or see what the API returns below.

Powered by the ZIP Codes API

The distance, the direction and both time zones above came from one call to the ZIP Codes API /v2/distance endpoint.

This comparison used 1 credits; a free key includes 2,500 a day.

Developers: see the exact request
curl -H "X-Api-Key: YOUR_KEY" "https://api.zip-codes.com/v2/distance?from=K1A+0A1&to=M5V"
View the JSON response

The real /v2/distance response for this pair. Coordinates are rounded to 3 decimals here; the API returns full precision.

{
  "success": true,
  "request": {
    "from": "K1A 0A1",
    "to": "M5V"
  },
  "results": [
    {
      "success": true,
      "input": {
        "from": "K1A 0A1",
        "to": "M5V"
      },
      "from": {
        "country": "CA",
        "code": "K1A 0A1",
        "code_type": "Postal",
        "city": "Ottawa",
        "state": "ON",
        "county": "Ottawa",
        "location": {
          "lat": 45.444,
          "lon": -75.685
        },
        "timezone": {
          "source": "IANA Time Zone Database / timezone-boundary-builder",
          "product": null,
          "attribution": null,
          "iana_name": "America/Toronto",
          "name": "Eastern",
          "abbreviation": "EST",
          "abbreviation_dst": "EDT",
          "utc_offset": -5,
          "utc_offset_dst": -4,
          "observes_dst": true
        },
        "input_type": "code"
      },
      "to": {
        "country": "CA",
        "code": "M5V",
        "code_type": "FSA",
        "city": "Toronto",
        "state": "ON",
        "county": null,
        "location": {
          "lat": 43.638,
          "lon": -79.404
        },
        "timezone": {
          "source": "IANA Time Zone Database / timezone-boundary-builder",
          "product": null,
          "attribution": null,
          "iana_name": "America/Toronto",
          "name": "Eastern",
          "abbreviation": "EST",
          "abbreviation_dst": "EDT",
          "utc_offset": -5,
          "utc_offset_dst": -4,
          "observes_dst": true
        },
        "input_type": "code"
      },
      "distance": {
        "miles": 221.57,
        "km": 356.59
      },
      "bearing": 237.1
    }
  ],
  "meta": {
    "credits": {
      "used": 1
    }
  }
}
Add distances like this to your app
  • Straight-line miles and kilometers between any two ZIP Codes, ZIP+4 Codes or Canadian postal codes
  • The compass direction and each place's time zone, with daylight saving time
  • Each place's facts and Census figures, 2011 to 2024
  • Batch up to 100 distances per call (paid plans)
  • Free key: 2,500 credits a day
Get a Free API Key Email This to My Developer