How to Calculate Straight-Line Distances
This guide walks you through every feature of the Straight Line Distance Calculator, from entering your first address pair to exporting a full batch of results.
Input Formats
The tool accepts origin-destination pairs separated by a tab, comma, or pipe character. Enter one pair per line.
Tab-Separated (recommended — paste from Excel/Sheets)
New York, NY Los Angeles, CA
Chicago, IL Houston, TX
Miami, FL Atlanta, GA
Pipe-Separated
New York, NY | Los Angeles, CA
Chicago, IL | Houston, TX
Pasting from Spreadsheets
Supported Location Types
You can enter any location that Google Maps can recognize:
- Full addresses:
123 Main St, Springfield, IL 62701 - City and state:
Denver, CO - ZIP codes:
90210 - City only:
Seattle(less precise — uses city center) - Landmarks:
Statue of Liberty - International:
10 Downing Street, London, UK
Address Precision
Entering Pairs Manually
Open the Tool
Type or Paste Your Pairs
Origin [tab/comma/pipe] Destination, one pair per line. The line counter on the left shows how many pairs you've entered.Select Your Unit
Click Calculate Distances
Importing from a File
For larger batches, import a CSV or Excel file:
Click "Import CSV / Excel"
Upload Your File
.csv, .xlsx, .xls.Column Mapping
Review and Calculate
Delimiter Auto-Detection
Understanding the Results
After calculation, results appear in a table with these columns:
| Column | Description |
|---|---|
| **#** | Row number matching your input order |
| **Origin** | The geocoded, standardized origin address |
| **Destination** | The geocoded, standardized destination address |
| **Distance** | Straight-line distance in your selected unit (miles or km) |
| **Status** | OK (success) or ERROR (with explanation) |
Result Summary
Above the results table, a summary card shows:
- Total pairs processed
- Successful calculations
- Failed calculations
- Processing time in milliseconds
Handling Errors
If a calculation fails, the Status column shows "ERROR" with a reason. Common causes:
- "Origin: No results found" — The origin address could not be geocoded. Check spelling or add more detail.
- "Destination: No results found" — Same issue for the destination.
- "Origin and destination are both required" — One or both fields were empty.
Partial Results
Switching Units
You can switch between miles and kilometers at any time using the unit dropdown. To recalculate with a different unit:
- Change the unit selector
- Click Calculate Distances again
- The tool re-runs the batch with the new unit
The haversine formula converts distances based on Earth's radius: 3,958.8 miles or 6,371.0 kilometers.
Sample Data
Click the Load Sample Data button to populate the input with example address pairs. This is useful for:
- Seeing the expected format before entering your own data
- Testing the tool with known locations
- Verifying your API key is working correctly
Tips for Best Results
- Be specific — Full addresses give more accurate coordinates than ZIP codes or city names.
- Use tab separation — Especially if your addresses contain commas.
- Batch similar requests — The tool deduplicates geocoding, so reusing the same origin across many pairs saves time.
- Check failed rows — Review errors and re-submit corrected pairs rather than the entire batch.
- Choose the right unit — Select miles or kilometers before calculating to avoid re-running.