ForHosting KIT · Travel & geography

Bearing to compass direction

A bearing of 22.5° reads as NNE, North-Northeast, and −45° wraps round to NW. Enter any heading in degrees and get the nearest of the 16 classic compass directions, its full name and the 22.5° sector it covers. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Compass bearing in degrees
22.5
You get
Bearing in
22.5
Bearing deg
22.5
Direction
NNE
Full name
North-Northeast

Navigation, mapping, and field apps often store a heading as a single number of degrees measured clockwise from north, then need a short compass label people can read at a glance. This capability takes any finite bearing, normalizes it onto the half-open interval from zero up to three hundred sixty degrees, and returns the nearest of the sixteen classical rose directions such as N, NNE, NE, or WNW, together with the full English name, the sector index, and the angular bounds of that sector. Non-finite values including NaN and positive or negative infinity are rejected with a clear invalid input error so bad sensor dumps never masquerade as north.

Sixteen directions, each 22.5 degrees wide

The classical compass rose splits the circle into sixteen directions: the four cardinals N, E, S and W, the four intercardinals such as NE, and eight in between such as NNE or WNW. Each one owns a sector 22.5 degrees wide centred on its exact bearing, so N sits at 0, NNE at 22.5 and NE at 45. The converter first wraps your number onto the range from 0 up to, but not including, 360, then picks the nearest centre. A bearing of 22.5° gives NNE, North-Northeast, whose sector runs from 11.25° to 33.75°.

Where the label helps and what to watch

A short label reads faster than a number on dashboards, alerts and exported tables, and it keeps every report using the same words for the same heading. A few details avoid surprises. Angles count clockwise from north, so 90° is east and 270° is west. Negative values and values of 360 or more are wrapped, which is why −45° comes out as NW and 360° as N. A bearing that falls exactly on the edge between two sectors is rounded up into the following one. Values that are not real numbers, such as a corrupted sensor reading, are rejected instead of being shown as north.

Telemetry and sensor pipelines

Normalize device headings and azimuths into N–NNW labels for dashboards, alerts, and CSV exports without reimplementing rose math in every service.

What happens if the bearing is NaN or Infinity?

Only finite numbers are accepted; non-finite values are rejected and not charged.

Does 0° mean north or east?

Zero degrees is north, measured clockwise (90° east, 180° south, 270° west), matching common navigation and GIS conventions.

Is the bearing to compass direction tool free?

The browser tool runs free on your device.

How is this different from a bearing-between-two-points calculator?

This capability only maps an existing degree value onto the 16-point rose.

Which direction does a bearing exactly on a sector boundary get?

It is rounded half up into the following direction clockwise. Each direction covers 22.5 degrees around its centre, so NNE runs from 11.25° to 33.75°, and a reading of exactly 11.25° is labelled NNE rather than N.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/geo/bearing-to-compass

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/geo/bearing-to-compass \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"bearing":22.5}'
{
  "bearing": 22.5
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "geo.bearing_to_compass",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

How degrees map onto the 16-point compass rose

Zero degrees means north; ninety means east; one hundred eighty means south; two hundred seventy means west. Values outside zero to three hundred sixty are reduced modulo three hundred sixty, and negative headings wrap the same way, so a sensor that reports minus forty five still lands on northwest. Each sector is twenty two point five degrees wide; the implementation chooses the nearest center with standard half-up rounding and wraps three hundred sixty back to north. Send a required field named bearing as a JSON number or a numeric string. Aliases degrees, deg, azimuth, heading, and angle are accepted when your upstream schema uses those names. The sixteen rose points sit on centers every twenty two point five degrees: N at zero, NNE at twenty two point five, NE at forty five, and so on around to NNW at three hundred thirty seven point five. On success you receive direction as the short label, full_name as the English phrase, bearing_in as the finite value accepted, bearing_deg as the normalized angle on zero inclusive to three hundred sixty exclusive, index from zero through fifteen, points equal to sixteen, sector_center_deg, sector_from_deg, sector_to_deg, and method set to sixteen_point_compass_rose. Identical finite inputs always produce identical JSON because the path is pure arithmetic with no network, no random seed, and no wall clock.

Validation, errors, and reading the response fields

The only hard rejection is a bearing that is not a finite number. Finite floating-point values including large magnitudes and scientific-notation strings that parse to a finite Number are accepted and then normalized. Use direction when a map pin, status line, or CSV column needs a compact label such as NNE. Missing input, empty strings, booleans, objects, non-numeric text, NaN, and positive or negative Infinity all fail with invalid_input and are not charged after the engine rejects the request. Use full_name when a report or screen reader needs North-Northeast spelled out. Use bearing_deg when you must show the wrapped angle next to the label, and bearing_in when audit logs should preserve the raw reading before modulo. Sector bounds describe the angular window associated with the chosen center under the half-width of eleven point two five degrees, with north wrapping across the zero meridian so sector_from_deg is three hundred forty eight point seven five and sector_to_deg is eleven point two five. This product does not compute a heading from two coordinates; for that search intent use a bearing-between-points calculator. It also does not solve great-circle geodesy or cross-track distance on a sphere.

API usage, pricing, workflows, and practical limits

Call the free in-browser bearing to compass direction tool for classroom demos, field notes, and quick mental checks without installing GIS software. Authors shipping SDKs can map direction straight into UI badges and use index for sprite frames of a compass rose graphic. Prefer documenting the zero-equals-north clockwise convention in your client so users who think in math-style angles measured from east counter-clockwise convert once before calling. Use the prepaid API when a mobile navigation backend, drone telemetry normalizer, sailing log importer, or logistics dashboard needs a stable contract under KIT balance at $0.002 per successful item. Pair the endpoint with a coordinate bearing calculator when you first obtain a heading from two points, then label it for humans; keep the two steps separate so each landing matches a distinct search intent. There is no per-request size limit beyond ordinary JSON, and the work is a handful of floating-point operations inside a Worker isolate, so latency stays analytic and predictable.

Maps and field apps

Show a readable compass direction next to a numeric bearing on mobile maps, hiking logs, and sailing trackers with a stable free-browser or API contract.

Teaching and automated tests

Homework checkers and CI fixtures pin expected labels for known angles and assert invalid_input when non-finite bearings are submitted.

How do I convert a bearing in degrees to a compass direction?

Send JSON with bearing set to a finite number (for example 22.5). The response includes direction (NNE), full_name, normalized bearing_deg, and sector index.

Read the full KIT documentation →