Geolocation Utilities

Decimal To Dms

Converts decimal degree coordinates to degrees-minutes-seconds format for precise geographic calculations. Access via MCP in Cursor or Windsurf, or call GET /v1/geo/decimal-to-dms with latitude/longitude parameters. Example: 40.7128 becomes 40°42'46"N. Returns structured DMS with cardinal directions for mapping applications and GPS systems.

API Endpoint

GET /v1/geo/decimal-to-dms

Code Examples

curl "https://tinyfn.io/v1/geo/decimal-to-dms" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/geo/decimal-to-dms', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/geo/decimal-to-dms',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's geolocation tools:

{
  "mcpServers": {
    "tinyfn-geo": {
      "url": "https://tinyfn.io/mcp/geo",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How do I convert decimal degrees to DMS format using MCP?

Pass decimal coordinates to the tool — it returns structured DMS with degrees, minutes, seconds, and cardinal directions (N/S/E/W). Works with any valid latitude (-90 to 90) or longitude (-180 to 180).

What's the difference between decimal degrees and DMS coordinates?

Decimal degrees use a single number (40.7128), while DMS breaks it into degrees, minutes, and seconds (40°42'46"). DMS is more precise for navigation and traditional surveying.

Can I convert negative decimal coordinates to DMS?

Yes — negative values automatically convert to proper cardinal directions. -40.7128 becomes 40°42'46"S, and -74.0060 becomes 74°0'21"W.

Does the DMS converter handle edge cases like exactly 0 degrees?

Yes, it properly handles 0.0 coordinates, the International Date Line (±180°), and poles (±90°). Minutes and seconds are calculated to standard precision.

How accurate is the decimal to DMS conversion for GPS applications?

The conversion maintains full precision of the input decimal degrees. Seconds are calculated with decimal precision, suitable for professional GPS and GIS workflows.

Try Decimal To Dms Now

Get your free API key and start using Decimal To Dms in seconds.

Get Free API Key