RGB to HSV converter
Turn an RGB color into the numbers a color wheel uses: orange 255, 128, 0 has a hue of about 30° with saturation 1 and value 1. Ideal when a picker or slider needs hue and brightness apart. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Resistance (Ω)
- 255
- G
- 128
- B
- 0
- H
- 30.1176470588
- S
- 1
- Voltage (V)
- 1
- H degrees
- 30.1176470588
This RGB to HSV converter takes three channel intensities—red, green, and blue—each as an integer from zero through two hundred fifty-five, and returns hue in degrees plus saturation and value as unit fractions from zero through one. Designers, front-end developers, and students use this mapping when a palette lives in sRGB channels but the UI needs a hue wheel, a saturation slider, or a brightness control that humans can reason about. The engine is fully deterministic: it normalizes each channel by two hundred fifty-five, finds the maximum and minimum, computes delta, then applies the classic six-sector hue formula and the standard saturation and value identities—never calling the network, sampling randomness, or depending on the clock.
How RGB maps to hue, saturation and value
In the eight-bit sRGB model used by CSS and most web graphics, each of red, green, and blue is an integer channel from zero through two hundred fifty-five. HSV rearranges that same color into three perceptual axes: hue is the position on the color wheel in degrees from zero inclusive to three hundred sixty exclusive, saturation is how pure the color is from gray at zero to full chroma at one, and value is overall brightness from black at zero to the brightest form of that hue at one.
Conversion first scales each channel by dividing by two hundred fifty-five, then sets Cmax to the largest of the three unit channels, Cmin to the smallest, and delta to their difference. Hue is zero when delta is zero (a gray axis); otherwise it comes from which channel is Cmax and a modular sector formula that maps red-dominant, green-dominant, and blue-dominant cases onto the wheel. Saturation is zero when Cmax is zero, otherwise delta over Cmax; value is simply Cmax.
There is no path that accepts percentages or floating-point channels as input, and no silent clamp of two hundred fifty-six down to two hundred fifty-five.
Where RGB-to-HSV conversion fits in design, study, and software
Designers meet this mapping when a brand guide lists RGB swatches and a hue-based picker or animation system needs H, S, and V, when a screenshot eyedropper reports red green blue and a generative palette must rotate hue while holding value, or when accessibility tooling must reason about brightness separately from chroma. Students see it in computer-graphics courses that introduce cylindrical color models, in digital art classes that move between channel sliders and HSV wheels, and in interview warm-ups that ask for a mental convert of a short triple.
Product and education tools use the conversion when a learner adjusts three RGB fields and the UI must show live hue, saturation, and value without a round-trip to a heavy graphics library. Pair it with multi-format color tools when you need hex or CMYK, and with other free deterministic converters when you are building a small lab for design-system hygiene.
What you can do with it
Hue wheels and palette tools
Turn brand RGB triples into hue, saturation, and value for pickers, generative palettes, and animation keyframes.
Homework and teaching demos
Check student RGB-to-HSV work and live-demo cylindrical color models without opaque calculator apps.
FAQ
What does the RGB to HSV converter cost?
It is free in your browser on this page.
What range is allowed for r, g, and b?
Each channel must be an integer from 0 to 255 inclusive.
What units are h, s, and v?
Hue h is in degrees in [0, 360). Saturation s and value v are unit fractions in [0, 1].
Does this convert HSV back to RGB?
No. This tool only maps integer RGB channels to HSV. Use a reverse or multi-format color converter if you need HSV-to-RGB or other spaces.
What hue and saturation does a gray get?
Both are 0. When red, green and blue are equal, there is no gap between the largest and smallest channel, so the color sits on the gray axis and only value changes, from 0 for black to 1 for white.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/color/rgb-hsv \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"r":255,"g":128,"b":0}'const res = await fetch("https://api.kit.forhosting.com/color/rgb-hsv", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"r": 255,
"g": 128,
"b": 0
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/color/rgb-hsv",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"r": 255,
"g": 128,
"b": 0
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/color/rgb-hsv", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"r":255,"g":128,"b":0}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"r":255,"g":128,"b":0}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/color/rgb-hsv", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"r": 255,
"g": 128,
"b": 0
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "color.rgb_hsv",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
min_channel | 0 |
max_channel | 255 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Channels outside zero through two hundred fifty-five are rejected with a clear invalid_input error rather than silently clamped.
What RGB-to-HSV conversion means and what the response contains
This calculator returns the validated integers r, g, and b, rounded h, s, and v, duplicate h_degrees for clarity, s_percent and v_percent scaled by one hundred for slider UIs, an rgb function string, an hsv summary string, a method tag rgb_to_hsv, and a short formula reminder. The engine either builds an exact HSV triple for three legal channels or rejects the request with invalid_input. Rejected cases include a missing r, g, or b field, empty strings after trimming, non-integer numbers, non-numeric text, Infinity or NaN, and any channel strictly below zero or above two hundred fifty-five.
How r, g, and b are read and how HSV stays reproducible
Outer whitespace on string channels is trimmed; an optional leading plus is allowed only when the remaining characters are decimal digits that parse to an integer in range. A bare JavaScript number is accepted only when it is a finite integer inside zero through two hundred fifty-five; values such as one hundred twenty-eight point five fail validation rather than being rounded, and negative or two-hundred-fifty-six-plus values fail with a message that names the channel and states that it must stay inside zero through two hundred fifty-five. Pure red maps to hue zero with full saturation and value; pure black maps to zero hue, zero saturation, and zero value; mixed channels such as two hundred fifty-five, one hundred twenty-eight, zero produce a warm hue near thirty degrees with full saturation and value. The preferred fields are r for red, g for green, and b for blue, but aliases red and capital R for red, green and capital G for green, and blue and capital B for blue are accepted so spreadsheets, query strings, and typed forms can reuse the same contract without renaming columns. After validation, conversion uses only closed-form arithmetic on the unit channels, then rounds floating components to a fixed decimal width so JSON goldens and CI assertions stay stable across platforms. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline without re-implementing channel normalization yourself.
Where RGB-to-HSV conversion fits in design, study, and software
On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split—free interactive exploration and a priced, identical API—matches the rest of the KIT tier-A catalog and lets you move from a classroom demo or design review to an automated pipeline without changing the mathematical result.
Integration use cases
Deterministic test fixtures
Generate reproducible HSV results for unit tests, property checks, and CI assertions on color helpers.
Technical questions
Why is 256 rejected instead of clamped?
Silent clamping hides data errors. Out-of-range channels fail with invalid_input so callers fix the source values instead of publishing the wrong color.